diff --git a/include/zmq.h b/include/zmq.h index 873e913e..edf47326 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -66,10 +66,9 @@ extern "C" { #ifdef __MINGW32__ // Require Windows XP or higher with MinGW for getaddrinfo(). -#if(_WIN32_WINNT >= 0x0600) +#if(_WIN32_WINNT >= 0x0501) #else -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0600 +#error You need at least Windows XP target #endif #endif #include diff --git a/src/condition_variable.hpp b/src/condition_variable.hpp index 910e4afc..6452b781 100644 --- a/src/condition_variable.hpp +++ b/src/condition_variable.hpp @@ -39,9 +39,22 @@ #ifdef ZMQ_HAVE_WINDOWS #include "windows.hpp" +#if defined(_MSC_VER) +#if _MSC_VER >= 1800 +#define _SUPPORT_CONDITION_VARIABLE 1 +#else +#define _SUPPORT_CONDITION_VARIABLE 0 +#endif +#else +#if _cplusplus >= 201103L +#define _SUPPORT_CONDITION_VARIABLE 1 +#else +#define _SUPPORT_CONDITION_VARIABLE 0 +#endif +#endif // Condition variable is supported from Windows Vista only, to use condition variable define _WIN32_WINNT to 0x0600 -#if _WIN32_WINNT < 0x0600 +#if _WIN32_WINNT < 0x0600 && !_SUPPORT_CONDITION_VARIABLE namespace zmq { @@ -81,7 +94,7 @@ namespace zmq #else -#ifdef ZMQ_HAVE_WINDOWS_TARGET_XP +#if _SUPPORT_CONDITION_VARIABLE || defined(ZMQ_HAVE_WINDOWS_TARGET_XP) #include #include #endif @@ -89,7 +102,7 @@ namespace zmq namespace zmq { -#ifndef ZMQ_HAVE_WINDOWS_TARGET_XP +#if !defined(ZMQ_HAVE_WINDOWS_TARGET_XP) && _WIN32_WINNT >= 0x0600 class condition_variable_t { public: diff --git a/src/windows.hpp b/src/windows.hpp index 098fd9a3..73e280e8 100644 --- a/src/windows.hpp +++ b/src/windows.hpp @@ -49,10 +49,9 @@ #ifdef __MINGW32__ // Require Windows XP or higher with MinGW for getaddrinfo(). -#if(_WIN32_WINNT >= 0x0600) +#if(_WIN32_WINNT >= 0x0501) #else -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0600 +#error You need at least Windows XP target #endif #endif