diff options
author | Steven McCoy <steven.mccoy@miru.hk> | 2011-06-12 19:37:11 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-06-12 19:37:11 +0200 |
commit | b164023cca3f29c5eb371a8a0757c98ae4683ae4 (patch) | |
tree | 48637be1f5611a4f98601a159ea26a8857d37014 | |
parent | ff93f54653d099bddfed34a342906a3546e70496 (diff) |
Fix scope on Windows includes.
Fix windows.h included before winsock2.h.
Remove definition of _WINSOCKAPI_.
Signed-off-by: Steven McCoy <steven.mccoy@miru.hk>
-rw-r--r-- | src/ctx.cpp | 8 | ||||
-rw-r--r-- | src/select.cpp | 2 | ||||
-rw-r--r-- | src/select.hpp | 2 | ||||
-rw-r--r-- | src/windows.hpp | 5 |
4 files changed, 10 insertions, 7 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp index fb5420d..6d6242e 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -31,9 +31,13 @@ #include "msg.hpp" #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 -#include "unistd.h" +#include <unistd.h> #endif zmq::ctx_t::ctx_t (uint32_t io_threads_) : diff --git a/src/select.cpp b/src/select.cpp index 35d8bd8..891bde1 100644 --- a/src/select.cpp +++ b/src/select.cpp @@ -24,7 +24,7 @@ #include <algorithm> #ifdef ZMQ_HAVE_WINDOWS -#include "winsock2.h" +#include <winsock2.h> #elif defined ZMQ_HAVE_HPUX #include <sys/param.h> #include <sys/types.h> diff --git a/src/select.hpp b/src/select.hpp index c88dd71..17ebd3f 100644 --- a/src/select.hpp +++ b/src/select.hpp @@ -27,7 +27,7 @@ #include <vector> #ifdef ZMQ_HAVE_WINDOWS -#include "winsock2.h" +#include <winsock2.h> #elif defined ZMQ_HAVE_OPENVMS #include <sys/types.h> #include <sys/time.h> diff --git a/src/windows.hpp b/src/windows.hpp index 5133875..fadee61 100644 --- a/src/windows.hpp +++ b/src/windows.hpp @@ -24,7 +24,6 @@ // The purpose of this header file is to turn on only the items actually needed // on the windows platform. -#define _WINSOCKAPI_ #ifndef NOMINMAX #define NOMINMAX // No min and max functions, these clash with C++. #endif @@ -50,11 +49,10 @@ #ifdef WINVER #undef WINVER #endif +// Default to Windows Server 2003, Windows XP #define WINVER 0x0501 #endif -#include <windows.h> - // MSVC++ 2005 on Win2000 does not define _WIN32_WINNT. #ifndef _WIN32_WINNT #define _WIN32_WINNT WINVER @@ -68,6 +66,7 @@ #include <winsock.h> #endif +#include <windows.h> #include <ws2tcpip.h> #include <ipexport.h> #include <process.h> |