So, to the previous three patches this one adds Winsock version 1 support back everywhere.
MinGW32 is technically busted as there is no way to detect the platform in the public header unless I'm missing something. -- Steve-o
From 3fae05d7005bbf387ffb25d0ea82322258c3dc32 Mon Sep 17 00:00:00 2001 From: Steven McCoy <[email protected]> Date: Thu, 16 Jun 2011 18:52:40 -0400 Subject: [PATCH] Update public header for WinSock version. Signed-off-by: Steven McCoy <[email protected]> --- include/zmq.h | 11 ++++++++++- src/windows.hpp | 10 ++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/include/zmq.h b/include/zmq.h index 1761f5a..130b2fd 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -28,8 +28,17 @@ extern "C" { #include <errno.h> #include <stddef.h> #if defined _WIN32 -#include "winsock2.h" +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #endif +#include <windows.h> +#if(_WIN32_WINNT >= 0x0400) +#include <winsock2.h> +#include <mswsock.h> +#else +#include <winsock.h> +#endif /* _WIN32_WINNT >= 0x0400 */ +#endif /* _WIN32 */ /* Handle DSO symbol visibility */ #if defined _WIN32 diff --git a/src/windows.hpp b/src/windows.hpp index b2d43f5..b83efd9 100644 --- a/src/windows.hpp +++ b/src/windows.hpp @@ -154,13 +154,12 @@ #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif + // Set target version to Windows Server 2003, Windows XP #define WINVER 0x0501 #define _WIN32_WINNT 0x0501 #endif -#include <winsock2.h> -#include <mswsock.h> #include <windows.h> // MSVC++ 2005 on Win2000 does not define _WIN32_WINNT. @@ -168,6 +167,13 @@ #define _WIN32_WINNT WINVER #endif +#if(_WIN32_WINNT >= 0x0400) +#include <winsock2.h> +#include <mswsock.h> +#else +#include <winsock.h> +#endif /* _WIN32_WINNT >= 0x0400 */ + #include <ws2tcpip.h> #include <ipexport.h> #include <process.h> -- 1.7.5.3
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
