aboutsummaryrefslogtreecommitdiff
path: root/src/compat.h
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2021-02-12 15:56:15 +0100
committerVasil Dimov <vd@FreeBSD.org>2021-03-01 13:22:17 +0100
commit78fdfbea666201b25919dd67454eb04d6a34326f (patch)
tree95fd390aa3d5666b17e7895c8a7f0b5d0bc138d8 /src/compat.h
parent34bcfab562bac9887ca9c3831cf4fd0ee7f98149 (diff)
downloadbitcoin-78fdfbea666201b25919dd67454eb04d6a34326f.tar.xz
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.h10
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