Commit b164023c authored by Steven McCoy's avatar Steven McCoy Committed by Martin Sustrik

Fix scope on Windows includes.

Fix windows.h included before winsock2.h.
Remove definition of _WINSOCKAPI_.
Signed-off-by: 's avatarSteven McCoy <steven.mccoy@miru.hk>
parent ff93f546
...@@ -31,9 +31,13 @@ ...@@ -31,9 +31,13 @@
#include "msg.hpp" #include "msg.hpp"
#if defined ZMQ_HAVE_WINDOWS #if defined ZMQ_HAVE_WINDOWS
#include "windows.h" #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
#include <windows.h>
#else #else
#include "unistd.h" #include <unistd.h>
#endif #endif
zmq::ctx_t::ctx_t (uint32_t io_threads_) : zmq::ctx_t::ctx_t (uint32_t io_threads_) :
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <algorithm> #include <algorithm>
#ifdef ZMQ_HAVE_WINDOWS #ifdef ZMQ_HAVE_WINDOWS
#include "winsock2.h" #include <winsock2.h>
#elif defined ZMQ_HAVE_HPUX #elif defined ZMQ_HAVE_HPUX
#include <sys/param.h> #include <sys/param.h>
#include <sys/types.h> #include <sys/types.h>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <vector> #include <vector>
#ifdef ZMQ_HAVE_WINDOWS #ifdef ZMQ_HAVE_WINDOWS
#include "winsock2.h" #include <winsock2.h>
#elif defined ZMQ_HAVE_OPENVMS #elif defined ZMQ_HAVE_OPENVMS
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
// The purpose of this header file is to turn on only the items actually needed // The purpose of this header file is to turn on only the items actually needed
// on the windows platform. // on the windows platform.
#define _WINSOCKAPI_
#ifndef NOMINMAX #ifndef NOMINMAX
#define NOMINMAX // No min and max functions, these clash with C++. #define NOMINMAX // No min and max functions, these clash with C++.
#endif #endif
...@@ -50,11 +49,10 @@ ...@@ -50,11 +49,10 @@
#ifdef WINVER #ifdef WINVER
#undef WINVER #undef WINVER
#endif #endif
// Default to Windows Server 2003, Windows XP
#define WINVER 0x0501 #define WINVER 0x0501
#endif #endif
#include <windows.h>
// MSVC++ 2005 on Win2000 does not define _WIN32_WINNT. // MSVC++ 2005 on Win2000 does not define _WIN32_WINNT.
#ifndef _WIN32_WINNT #ifndef _WIN32_WINNT
#define _WIN32_WINNT WINVER #define _WIN32_WINNT WINVER
...@@ -68,6 +66,7 @@ ...@@ -68,6 +66,7 @@
#include <winsock.h> #include <winsock.h>
#endif #endif
#include <windows.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <ipexport.h> #include <ipexport.h>
#include <process.h> #include <process.h>
......
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