From 997825bdf1e436d67c08b62e97e17b4740a19155 Mon Sep 17 00:00:00 2001 From: Christopher Hall Date: Tue, 3 Oct 2017 15:30:42 +0800 Subject: [PATCH] add __FreeBSD__ to ifdefs On FreeBSD the sysmbol __FreeBSD_kernel__ is only defines if a specific param.h file is included, unlike Debian/kFreeBSD where this symbol is always defined. So also compile the FreeBSD specific code if __FreeBSD__ is defined for FreeBSD 11 & 12 compatibility. Signed-off-by: Christopher Hall --- src/stream_engine.cpp | 2 +- src/thread.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp index c8dad805..946f1c5e 100644 --- a/src/stream_engine.cpp +++ b/src/stream_engine.cpp @@ -149,7 +149,7 @@ zmq::stream_engine_t::~stream_engine_t () wsa_assert (rc != SOCKET_ERROR); #else int rc = close (s); -#ifdef __FreeBSD_kernel__ +#if defined(__FreeBSD_kernel__) || defined (__FreeBSD__) // FreeBSD may return ECONNRESET on close() under load but this is not // an error. if (rc == -1 && errno == ECONNRESET) diff --git a/src/thread.cpp b/src/thread.cpp index d39b7ce5..dde6bb4b 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -152,7 +152,7 @@ void zmq::thread_t::setSchedulingParameters(int priority_, int schedulingPolicy_ rc = pthread_setschedparam(descriptor, policy, ¶m); -#ifdef __FreeBSD_kernel__ +#if defined(__FreeBSD_kernel__) || defined (__FreeBSD__) // If this feature is unavailable at run-time, don't abort. if(rc == ENOSYS) return; #endif