diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-03-05 09:29:37 +0000 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-03-05 09:29:37 +0000 |
commit | c459d509b7c7fe7d8200ea3791d1ef0b245126ab (patch) | |
tree | 1680a383df94368ac23b57d495d99352ce0220d3 /src | |
parent | 53c300fb525ab3e21206d47d8353f5246b4f24d1 (diff) |
build: Probe MSG_DONTWAIT in the same way as MSG_NOSIGNAL
Instead of the WIN32-specific workaround, detect lack of `MSG_DONTWAIT`
in the build system. This allows other platforms without `MSG_DONTWAIT`
to work too.
Diffstat (limited to 'src')
-rw-r--r-- | src/compat.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compat.h b/src/compat.h index 28aa77eea2..6f4d4e65f0 100644 --- a/src/compat.h +++ b/src/compat.h @@ -47,9 +47,7 @@ #include <unistd.h> #endif -#ifdef WIN32 -#define MSG_DONTWAIT 0 -#else +#ifndef WIN32 typedef u_int SOCKET; #include "errno.h" #define WSAGetLastError() errno @@ -79,6 +77,11 @@ typedef u_int SOCKET; #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) && !defined(MSG_DONTWAIT) +#define MSG_DONTWAIT 0 +#endif + #if HAVE_DECL_STRNLEN == 0 size_t strnlen( const char *start, size_t max_len); #endif // HAVE_DECL_STRNLEN |