From cb211e4f1e031e44dbfdf68f133d1b638f6ca530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Schl=C3=BCter?= Date: Fri, 13 Sep 2019 13:26:44 +0900 Subject: [PATCH] Problem: inclusion of winsock2.h leads to ordering issues in user code. Solution: don't include winsock2.h, replace its only use (reference to SOCKET) by explicitly naming underlying type. --- include/zmq.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/zmq.h b/include/zmq.h index edf28efd..03be03c2 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -71,7 +71,6 @@ extern "C" { #error You need at least Windows XP target #endif #endif -#include #endif /* Handle DSO symbol visibility */ @@ -498,7 +497,12 @@ ZMQ_EXPORT int zmq_socket_monitor (void *s_, const char *addr_, int events_); /******************************************************************************/ #if defined _WIN32 -typedef SOCKET zmq_fd_t; +// Windows uses a pointer-sized unsigned integer to store the socket fd. +#if defined _WIN64 +typedef unsigned __int64 zmq_fd_t; +#else +typedef unsigned int zmq_fd_t; +#endif #else typedef int zmq_fd_t; #endif