Commit 2a79a943 authored by Martin Lucina's avatar Martin Lucina

Add NetBSD support

parent 776b1263
...@@ -154,6 +154,19 @@ case "${host_os}" in ...@@ -154,6 +154,19 @@ case "${host_os}" in
AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS]) AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS])
LIBZMQ_EXTRA_CXXFLAGS+="-Wno-uninitialized" LIBZMQ_EXTRA_CXXFLAGS+="-Wno-uninitialized"
;; ;;
*netbsd*)
# Define on NetBSD to enable all library features
CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS"
AC_DEFINE(ZMQ_HAVE_NETBSD, 1, [Have NetBSD OS])
# NetBSD 5.0 and newer provides atomic operations
netbsd_has_atomic=no
# XXX As of 5.0.1 the functions declared in atomic.h are
# missing "extern C", disable this until upstream fixes it.
# AC_CHECK_HEADERS(atomic.h, [netbsd_has_atomic=yes])
if test "x$netbsd_has_atomic" = "xno"; then
AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes])
fi
;;
*openbsd*) *openbsd*)
# Define on OpenBSD to enable all library features # Define on OpenBSD to enable all library features
CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS" CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#define ZMQ_ATOMIC_BITMAP_SPARC #define ZMQ_ATOMIC_BITMAP_SPARC
#elif defined ZMQ_HAVE_WINDOWS #elif defined ZMQ_HAVE_WINDOWS
#define ZMQ_ATOMIC_BITMAP_WINDOWS #define ZMQ_ATOMIC_BITMAP_WINDOWS
#elif defined ZMQ_HAVE_SOLARIS #elif (defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_NETBSD)
#define ZMQ_ATOMIC_BITMAP_SOLARIS #define ZMQ_ATOMIC_BITMAP_SYSTEM
#else #else
#define ZMQ_ATOMIC_BITMAP_MUTEX #define ZMQ_ATOMIC_BITMAP_MUTEX
#endif #endif
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include "mutex.hpp" #include "mutex.hpp"
#elif defined ZMQ_ATOMIC_BITMAP_WINDOWS #elif defined ZMQ_ATOMIC_BITMAP_WINDOWS
#include "windows.hpp" #include "windows.hpp"
#elif defined ZMQ_ATOMIC_BITMAP_SOLARIS #elif defined ZMQ_ATOMIC_BITMAP_SYSTEM
#include <atomic.h> #include <atomic.h>
#endif #endif
...@@ -89,7 +89,7 @@ namespace zmq ...@@ -89,7 +89,7 @@ namespace zmq
return (oldval & (bitmap_t (1) << reset_index_)) ? return (oldval & (bitmap_t (1) << reset_index_)) ?
true : false; true : false;
} }
#elif defined ZMQ_ATOMIC_BITMAP_SOLARIS #elif defined ZMQ_ATOMIC_BITMAP_SYSTEM
while (true) { while (true) {
bitmap_t oldval = value; bitmap_t oldval = value;
bitmap_t newval = (oldval | (bitmap_t (1) << set_index_)) & bitmap_t newval = (oldval | (bitmap_t (1) << set_index_)) &
...@@ -150,7 +150,7 @@ namespace zmq ...@@ -150,7 +150,7 @@ namespace zmq
bitmap_t oldval; bitmap_t oldval;
#if defined ZMQ_ATOMIC_BITMAP_WINDOWS #if defined ZMQ_ATOMIC_BITMAP_WINDOWS
oldval = InterlockedExchange ((volatile LONG*) &value, newval_); oldval = InterlockedExchange ((volatile LONG*) &value, newval_);
#elif defined ZMQ_ATOMIC_BITMAP_SOLARIS #elif defined ZMQ_ATOMIC_BITMAP_SYSTEM
oldval = atomic_swap_32 (&value, newval_); oldval = atomic_swap_32 (&value, newval_);
#elif defined ZMQ_ATOMIC_BITMAP_X86 #elif defined ZMQ_ATOMIC_BITMAP_X86
oldval = newval_; oldval = newval_;
...@@ -201,7 +201,7 @@ namespace zmq ...@@ -201,7 +201,7 @@ namespace zmq
newval, oldval) == (LONG) oldval) newval, oldval) == (LONG) oldval)
return oldval; return oldval;
} }
#elif defined ZMQ_ATOMIC_BITMAP_SOLARIS #elif defined ZMQ_ATOMIC_BITMAP_SYSTEM
while (true) { while (true) {
bitmap_t oldval = value; bitmap_t oldval = value;
bitmap_t newval = oldval == 0 ? thenval_ : elseval_; bitmap_t newval = oldval == 0 ? thenval_ : elseval_;
...@@ -270,8 +270,8 @@ namespace zmq ...@@ -270,8 +270,8 @@ namespace zmq
#if defined ZMQ_ATOMIC_BITMAP_WINDOWS #if defined ZMQ_ATOMIC_BITMAP_WINDOWS
#undef ZMQ_ATOMIC_BITMAP_WINDOWS #undef ZMQ_ATOMIC_BITMAP_WINDOWS
#endif #endif
#if defined ZMQ_ATOMIC_BITMAP_SOLARIS #if defined ZMQ_ATOMIC_BITMAP_SYSTEM
#undef ZMQ_ATOMIC_BITMAP_SOLARIS #undef ZMQ_ATOMIC_BITMAP_SYSTEM
#endif #endif
#if defined ZMQ_ATOMIC_BITMAP_X86 #if defined ZMQ_ATOMIC_BITMAP_X86
#undef ZMQ_ATOMIC_BITMAP_X86 #undef ZMQ_ATOMIC_BITMAP_X86
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#define ZMQ_ATOMIC_COUNTER_SPARC #define ZMQ_ATOMIC_COUNTER_SPARC
#elif defined ZMQ_HAVE_WINDOWS #elif defined ZMQ_HAVE_WINDOWS
#define ZMQ_ATOMIC_COUNTER_WINDOWS #define ZMQ_ATOMIC_COUNTER_WINDOWS
#elif defined ZMQ_HAVE_SOLARIS #elif (defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_NETBSD)
#define ZMQ_ATOMIC_COUNTER_SOLARIS #define ZMQ_ATOMIC_COUNTER_SYSTEM
#else #else
#define ZMQ_ATOMIC_COUNTER_MUTEX #define ZMQ_ATOMIC_COUNTER_MUTEX
#endif #endif
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "mutex.hpp" #include "mutex.hpp"
#elif defined ZMQ_ATOMIC_COUNTER_WINDOWS #elif defined ZMQ_ATOMIC_COUNTER_WINDOWS
#include "windows.hpp" #include "windows.hpp"
#elif defined ZMQ_ATOMIC_COUNTER_SOLARIS #elif defined ZMQ_ATOMIC_COUNTER_SYSTEM
#include <atomic.h> #include <atomic.h>
#endif #endif
...@@ -79,7 +79,7 @@ namespace zmq ...@@ -79,7 +79,7 @@ namespace zmq
#if defined ZMQ_ATOMIC_COUNTER_WINDOWS #if defined ZMQ_ATOMIC_COUNTER_WINDOWS
old_value = InterlockedExchangeAdd ((LONG*) &value, increment_); old_value = InterlockedExchangeAdd ((LONG*) &value, increment_);
#elif defined ZMQ_ATOMIC_COUNTER_SOLARIS #elif defined ZMQ_ATOMIC_COUNTER_SYSTEM
integer_t new_value = atomic_add_32_nv (&value, increment_); integer_t new_value = atomic_add_32_nv (&value, increment_);
old_value = new_value - increment_; old_value = new_value - increment_;
#elif defined ZMQ_ATOMIC_COUNTER_X86 #elif defined ZMQ_ATOMIC_COUNTER_X86
...@@ -119,7 +119,7 @@ namespace zmq ...@@ -119,7 +119,7 @@ namespace zmq
LONG delta = - ((LONG) decrement); LONG delta = - ((LONG) decrement);
integer_t old = InterlockedExchangeAdd ((LONG*) &value, delta); integer_t old = InterlockedExchangeAdd ((LONG*) &value, delta);
return old - decrement != 0; return old - decrement != 0;
#elif defined ZMQ_ATOMIC_COUNTER_SOLARIS #elif defined ZMQ_ATOMIC_COUNTER_SYSTEM
int32_t delta = - ((int32_t) decrement); int32_t delta = - ((int32_t) decrement);
integer_t nv = atomic_add_32_nv (&value, delta); integer_t nv = atomic_add_32_nv (&value, delta);
return nv != 0; return nv != 0;
...@@ -180,8 +180,8 @@ namespace zmq ...@@ -180,8 +180,8 @@ namespace zmq
#if defined ZMQ_ATOMIC_COUNTER_WINDOWS #if defined ZMQ_ATOMIC_COUNTER_WINDOWS
#undef ZMQ_ATOMIC_COUNTER_WINDOWS #undef ZMQ_ATOMIC_COUNTER_WINDOWS
#endif #endif
#if defined ZMQ_ATOMIC_COUNTER_SOLARIS #if defined ZMQ_ATOMIC_COUNTER_SYSTEM
#undef ZMQ_ATOMIC_COUNTER_SOLARIS #undef ZMQ_ATOMIC_COUNTER_SYSTEM
#endif #endif
#if defined ZMQ_ATOMIC_COUNTER_X86 #if defined ZMQ_ATOMIC_COUNTER_X86
#undef ZMQ_ATOMIC_COUNTER_X86 #undef ZMQ_ATOMIC_COUNTER_X86
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#define ZMQ_ATOMIC_PTR_SPARC #define ZMQ_ATOMIC_PTR_SPARC
#elif defined ZMQ_HAVE_WINDOWS #elif defined ZMQ_HAVE_WINDOWS
#define ZMQ_ATOMIC_PTR_WINDOWS #define ZMQ_ATOMIC_PTR_WINDOWS
#elif defined ZMQ_HAVE_SOLARIS #elif (defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_NETBSD)
#define ZMQ_ATOMIC_PTR_SOLARIS #define ZMQ_ATOMIC_PTR_SYSTEM
#else #else
#define ZMQ_ATOMIC_PTR_MUTEX #define ZMQ_ATOMIC_PTR_MUTEX
#endif #endif
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "mutex.hpp" #include "mutex.hpp"
#elif defined ZMQ_ATOMIC_PTR_WINDOWS #elif defined ZMQ_ATOMIC_PTR_WINDOWS
#include "windows.hpp" #include "windows.hpp"
#elif defined ZMQ_ATOMIC_PTR_SOLARIS #elif defined ZMQ_ATOMIC_PTR_SYSTEM
#include <atomic.h> #include <atomic.h>
#endif #endif
...@@ -79,7 +79,7 @@ namespace zmq ...@@ -79,7 +79,7 @@ namespace zmq
{ {
#if defined ZMQ_ATOMIC_PTR_WINDOWS #if defined ZMQ_ATOMIC_PTR_WINDOWS
return (T*) InterlockedExchangePointer (&ptr, val_); return (T*) InterlockedExchangePointer (&ptr, val_);
#elif defined ZMQ_ATOMIC_PTR_SOLARIS #elif defined ZMQ_ATOMIC_PTR_SYSTEM
return (T*) atomic_swap_ptr (&ptr, val_); return (T*) atomic_swap_ptr (&ptr, val_);
#elif defined ZMQ_ATOMIC_PTR_X86 #elif defined ZMQ_ATOMIC_PTR_X86
T *old; T *old;
...@@ -125,7 +125,7 @@ namespace zmq ...@@ -125,7 +125,7 @@ namespace zmq
#if defined ZMQ_ATOMIC_PTR_WINDOWS #if defined ZMQ_ATOMIC_PTR_WINDOWS
return (T*) InterlockedCompareExchangePointer ( return (T*) InterlockedCompareExchangePointer (
(volatile PVOID*) &ptr, val_, cmp_); (volatile PVOID*) &ptr, val_, cmp_);
#elif defined ZMQ_ATOMIC_PTR_SOLARIS #elif defined ZMQ_ATOMIC_PTR_SYSTEM
return (T*) atomic_cas_ptr (&ptr, cmp_, val_); return (T*) atomic_cas_ptr (&ptr, cmp_, val_);
#elif defined ZMQ_ATOMIC_PTR_X86 #elif defined ZMQ_ATOMIC_PTR_X86
T *old; T *old;
...@@ -173,8 +173,8 @@ namespace zmq ...@@ -173,8 +173,8 @@ namespace zmq
#if defined ZMQ_ATOMIC_PTR_WINDOWS #if defined ZMQ_ATOMIC_PTR_WINDOWS
#undef ZMQ_ATOMIC_PTR_WINDOWS #undef ZMQ_ATOMIC_PTR_WINDOWS
#endif #endif
#if defined ZMQ_ATOMIC_PTR_SOLARIS #if defined ZMQ_ATOMIC_PTR_SYSTEM
#undef ZMQ_ATOMIC_PTR_SOLARIS #undef ZMQ_ATOMIC_PTR_SYSTEM
#endif #endif
#if defined ZMQ_ATOMIC_PTR_X86 #if defined ZMQ_ATOMIC_PTR_X86
#undef ZMQ_ATOMIC_PTR_X86 #undef ZMQ_ATOMIC_PTR_X86
......
...@@ -125,7 +125,8 @@ static int resolve_nic_name (in_addr* addr_, char const *interface_) ...@@ -125,7 +125,8 @@ static int resolve_nic_name (in_addr* addr_, char const *interface_)
#elif ((defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\ #elif ((defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_OPENBSD ||\ defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_OPENBSD ||\
defined ZMQ_HAVE_QNXNTO) && defined ZMQ_HAVE_IFADDRS) defined ZMQ_HAVE_QNXNTO || defined ZMQ_HAVE_NETBSD)\
&& defined ZMQ_HAVE_IFADDRS)
#include <ifaddrs.h> #include <ifaddrs.h>
...@@ -239,11 +240,7 @@ int zmq::resolve_ip_interface (sockaddr_storage* addr_, socklen_t *addr_len_, ...@@ -239,11 +240,7 @@ int zmq::resolve_ip_interface (sockaddr_storage* addr_, socklen_t *addr_len_,
// Restrict hostname/service to literals to avoid any DNS lookups or // Restrict hostname/service to literals to avoid any DNS lookups or
// service-name irregularity due to indeterminate socktype. // service-name irregularity due to indeterminate socktype.
#if defined ZMQ_HAVE_OSX
req.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
#else
req.ai_flags = AI_PASSIVE | AI_NUMERICHOST | AI_NUMERICSERV; req.ai_flags = AI_PASSIVE | AI_NUMERICHOST | AI_NUMERICSERV;
#endif
// Resolve the literal address. Some of the error info is lost in case // Resolve the literal address. Some of the error info is lost in case
// of error, however, there's no way to report EAI errors via errno. // of error, however, there's no way to report EAI errors via errno.
...@@ -292,11 +289,7 @@ int zmq::resolve_ip_hostname (sockaddr_storage *addr_, socklen_t *addr_len_, ...@@ -292,11 +289,7 @@ int zmq::resolve_ip_hostname (sockaddr_storage *addr_, socklen_t *addr_len_,
// Avoid named services due to unclear socktype, and don't pick IPv6 // Avoid named services due to unclear socktype, and don't pick IPv6
// addresses if we don't have a local IPv6 address configured. // addresses if we don't have a local IPv6 address configured.
#if defined ZMQ_HAVE_OSX
req.ai_flags = AI_ADDRCONFIG;
#else
req.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG; req.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG;
#endif
// Resolve host name. Some of the error info is lost in case of error, // Resolve host name. Some of the error info is lost in case of error,
// however, there's no way to report EAI errors via errno. // however, there's no way to report EAI errors via errno.
......
...@@ -30,6 +30,16 @@ ...@@ -30,6 +30,16 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netdb.h> #include <netdb.h>
// Some platforms (notably Darwin/OSX and NetBSD) do not define all AI_
// flags for getaddrinfo(). This can be worked around safely by defining
// these to 0.
#ifndef AI_ADDRCONFIG
#define AI_ADDRCONFIG 0
#endif
#ifndef AI_NUMERICSERV
#define AI_NUMERICSERV 0
#endif
#endif #endif
#if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
#include "platform.hpp" #include "platform.hpp"
#if defined ZMQ_HAVE_FREEBSD || defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_OSX #if defined ZMQ_HAVE_FREEBSD || defined ZMQ_HAVE_OPENBSD ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_NETBSD
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -34,6 +35,14 @@ ...@@ -34,6 +35,14 @@
#include "config.hpp" #include "config.hpp"
#include "i_poll_events.hpp" #include "i_poll_events.hpp"
// NetBSD defines (struct kevent).udata as intptr_t, everyone else
// as void *.
#if defined ZMQ_HAVE_NETBSD
#define kevent_udata_t intptr_t
#else
#define kevent_udata_t void *
#endif
zmq::kqueue_t::kqueue_t () : zmq::kqueue_t::kqueue_t () :
stopping (false) stopping (false)
{ {
...@@ -56,7 +65,7 @@ void zmq::kqueue_t::kevent_add (fd_t fd_, short filter_, void *udata_) ...@@ -56,7 +65,7 @@ void zmq::kqueue_t::kevent_add (fd_t fd_, short filter_, void *udata_)
{ {
struct kevent ev; struct kevent ev;
EV_SET (&ev, fd_, filter_, EV_ADD, 0, 0, udata_); EV_SET (&ev, fd_, filter_, EV_ADD, 0, 0, (kevent_udata_t)udata_);
int rc = kevent (kqueue_fd, &ev, 1, NULL, 0, NULL); int rc = kevent (kqueue_fd, &ev, 1, NULL, 0, NULL);
errno_assert (rc != -1); errno_assert (rc != -1);
} }
...@@ -65,7 +74,7 @@ void zmq::kqueue_t::kevent_delete (fd_t fd_, short filter_) ...@@ -65,7 +74,7 @@ void zmq::kqueue_t::kevent_delete (fd_t fd_, short filter_)
{ {
struct kevent ev; struct kevent ev;
EV_SET (&ev, fd_, filter_, EV_DELETE, 0, 0, NULL); EV_SET (&ev, fd_, filter_, EV_DELETE, 0, 0, (kevent_udata_t)NULL);
int rc = kevent (kqueue_fd, &ev, 1, NULL, 0, NULL); int rc = kevent (kqueue_fd, &ev, 1, NULL, 0, NULL);
errno_assert (rc != -1); errno_assert (rc != -1);
} }
...@@ -212,4 +221,6 @@ void zmq::kqueue_t::worker_routine (void *arg_) ...@@ -212,4 +221,6 @@ void zmq::kqueue_t::worker_routine (void *arg_)
((kqueue_t*) arg_)->loop (); ((kqueue_t*) arg_)->loop ();
} }
// Don't pollute namespace with defines local to this file
#undef kevent_udata_t
#endif #endif
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#include "platform.hpp" #include "platform.hpp"
#if defined ZMQ_HAVE_FREEBSD || defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_OSX #if defined ZMQ_HAVE_FREEBSD || defined ZMQ_HAVE_OPENBSD ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_NETBSD
#include <vector> #include <vector>
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
#if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\ #if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\ defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\ defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\
defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX ||\
defined ZMQ_HAVE_NETBSD
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\ #if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\ defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\ defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\
defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX ||\
defined ZMQ_HAVE_NETBSD
#include <poll.h> #include <poll.h>
#include <stddef.h> #include <stddef.h>
......
...@@ -47,6 +47,8 @@ namespace zmq ...@@ -47,6 +47,8 @@ namespace zmq
typedef kqueue_t poller_t; typedef kqueue_t poller_t;
#elif defined ZMQ_HAVE_OPENBSD #elif defined ZMQ_HAVE_OPENBSD
typedef kqueue_t poller_t; typedef kqueue_t poller_t;
#elif defined ZMQ_HAVE_NETBSD
typedef kqueue_t poller_t;
#elif defined ZMQ_HAVE_SOLARIS #elif defined ZMQ_HAVE_SOLARIS
typedef devpoll_t poller_t; typedef devpoll_t poller_t;
#elif defined ZMQ_HAVE_OSX #elif defined ZMQ_HAVE_OSX
......
...@@ -275,7 +275,7 @@ zmq::fd_t zmq::tcp_listener_t::accept () ...@@ -275,7 +275,7 @@ zmq::fd_t zmq::tcp_listener_t::accept ()
#if (defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD || \ #if (defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD || \
defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_OSX || \ defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_OSX || \
defined ZMQ_HAVE_OPENVMS) defined ZMQ_HAVE_OPENVMS || defined ZMQ_HAVE_NETBSD)
if (sock == -1 && if (sock == -1 &&
(errno == EAGAIN || errno == EWOULDBLOCK || (errno == EAGAIN || errno == EWOULDBLOCK ||
errno == EINTR || errno == ECONNABORTED)) errno == EINTR || errno == ECONNABORTED))
......
...@@ -47,7 +47,7 @@ const char *zmq::uuid_t::to_string () ...@@ -47,7 +47,7 @@ const char *zmq::uuid_t::to_string ()
return (char*) uuid_str; return (char*) uuid_str;
} }
#elif defined ZMQ_HAVE_FREEBSD #elif defined ZMQ_HAVE_FREEBSD || defined ZMQ_HAVE_NETBSD
#include <stdlib.h> #include <stdlib.h>
#include <uuid.h> #include <uuid.h>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "platform.hpp" #include "platform.hpp"
#include "stdint.hpp" #include "stdint.hpp"
#if defined ZMQ_HAVE_FREEBSD #if defined ZMQ_HAVE_FREEBSD || defined ZMQ_HAVE_NETBSD
#include <uuid.h> #include <uuid.h>
#elif defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OSX #elif defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OSX
#include <uuid/uuid.h> #include <uuid/uuid.h>
...@@ -60,7 +60,7 @@ namespace zmq ...@@ -60,7 +60,7 @@ namespace zmq
#endif #endif
::UUID uuid; ::UUID uuid;
RPC_CSTR uuid_str; RPC_CSTR uuid_str;
#elif defined ZMQ_HAVE_FREEBSD #elif defined ZMQ_HAVE_FREEBSD || defined ZMQ_HAVE_NETBSD
::uuid_t uuid; ::uuid_t uuid;
char *uuid_str; char *uuid_str;
#elif defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OSX #elif defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OSX
......
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
#if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\ #if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\ defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\ defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\
defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX ||\
defined ZMQ_HAVE_NETBSD
#include <poll.h> #include <poll.h>
#endif #endif
...@@ -325,7 +326,8 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) ...@@ -325,7 +326,8 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
#if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\ #if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\ defined ZMQ_HAVE_OPENBSD || defined ZMQ_HAVE_SOLARIS ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\ defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_QNXNTO ||\
defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_AIX ||\
defined ZMQ_HAVE_NETBSD
pollfd *pollfds = (pollfd*) malloc (nitems_ * sizeof (pollfd)); pollfd *pollfds = (pollfd*) malloc (nitems_ * sizeof (pollfd));
zmq_assert (pollfds); zmq_assert (pollfds);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment