aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-03-05 09:32:00 +0000
committerWladimir J. van der Laan <laanwj@gmail.com>2017-03-05 09:47:29 +0000
commit25da1ee36cfb99f6ef60e7883952c2370c718725 (patch)
tree305b5babe1c65e103ff63912b67524a9d8c20de9 /src/net.cpp
parentc459d509b7c7fe7d8200ea3791d1ef0b245126ab (diff)
downloadbitcoin-25da1ee36cfb99f6ef60e7883952c2370c718725.tar.xz
build: cleanup: define MSG_DONTWAIT/MSG_NO_SIGNAL locally
Define MSG_DONTWAIT and MSG_NO_SIGNAL in the implementation files that use them (`net.cpp` and `netbase.cpp`), instead of compat.h which is included all over the place. This avoids putting them in the global namespace, as defining them as 0 is a hack that works for our specific usage, but it is not a general solution. Also makes sure they are defined only once so the `!defined(MSG_x)` guard can go.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index e38d3b344e..8dc234d862 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -44,10 +44,15 @@
// We add a random period time (0 to 1 seconds) to feeler connections to prevent synchronization.
#define FEELER_SLEEP_WINDOW 1
-#if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL)
+#if !defined(HAVE_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(HAVE_MSG_DONTWAIT)
+#define MSG_DONTWAIT 0
+#endif
+
// Fix for ancient MinGW versions, that don't have defined these in ws2tcpip.h.
// Todo: Can be removed when our pull-tester is upgraded to a modern MinGW version.
#ifdef WIN32