diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-02-12 15:56:15 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-03-01 13:22:17 +0100 |
commit | 78fdfbea666201b25919dd67454eb04d6a34326f (patch) | |
tree | 95fd390aa3d5666b17e7895c8a7f0b5d0bc138d8 /src/compat.h | |
parent | 34bcfab562bac9887ca9c3831cf4fd0ee7f98149 (diff) |
net: dedup MSG_NOSIGNAL and MSG_DONTWAIT definitions
Deduplicate `MSG_NOSIGNAL` and `MSG_DONTWAIT` definitions from `net.cpp`
and `netbase.cpp` to `compat.h` where they can also be reused by other
code.
Diffstat (limited to 'src/compat.h')
-rw-r--r-- | src/compat.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compat.h b/src/compat.h index dad14748a2..640be23546 100644 --- a/src/compat.h +++ b/src/compat.h @@ -96,4 +96,14 @@ bool static inline IsSelectableSocket(const SOCKET& s) { #endif } +// MSG_NOSIGNAL is not available on some platforms, if it doesn't exist define it as 0 +#if !defined(MSG_NOSIGNAL) +#define MSG_NOSIGNAL 0 +#endif + +// MSG_DONTWAIT is not available on some platforms, if it doesn't exist define it as 0 +#if !defined(MSG_DONTWAIT) +#define MSG_DONTWAIT 0 +#endif + #endif // BITCOIN_COMPAT_H |