Commit cb266ee0 authored by Luca Boccassi's avatar Luca Boccassi Committed by GitHub

Merge pull request #2619 from diorcety/winxp

Partial Windows XP support
parents d4595421 81327af5
...@@ -66,10 +66,9 @@ extern "C" { ...@@ -66,10 +66,9 @@ extern "C" {
#ifdef __MINGW32__ #ifdef __MINGW32__
// Require Windows XP or higher with MinGW for getaddrinfo(). // Require Windows XP or higher with MinGW for getaddrinfo().
#if(_WIN32_WINNT >= 0x0600) #if(_WIN32_WINNT >= 0x0501)
#else #else
#undef _WIN32_WINNT #error You need at least Windows XP target
#define _WIN32_WINNT 0x0600
#endif #endif
#endif #endif
#include <winsock2.h> #include <winsock2.h>
......
...@@ -39,9 +39,22 @@ ...@@ -39,9 +39,22 @@
#ifdef ZMQ_HAVE_WINDOWS #ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp" #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 // 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 namespace zmq
{ {
...@@ -81,7 +94,7 @@ namespace zmq ...@@ -81,7 +94,7 @@ namespace zmq
#else #else
#ifdef ZMQ_HAVE_WINDOWS_TARGET_XP #if _SUPPORT_CONDITION_VARIABLE || defined(ZMQ_HAVE_WINDOWS_TARGET_XP)
#include <condition_variable> #include <condition_variable>
#include <mutex> #include <mutex>
#endif #endif
...@@ -89,7 +102,7 @@ namespace zmq ...@@ -89,7 +102,7 @@ namespace zmq
namespace zmq namespace zmq
{ {
#ifndef ZMQ_HAVE_WINDOWS_TARGET_XP #if !defined(ZMQ_HAVE_WINDOWS_TARGET_XP) && _WIN32_WINNT >= 0x0600
class condition_variable_t class condition_variable_t
{ {
public: public:
......
...@@ -49,10 +49,9 @@ ...@@ -49,10 +49,9 @@
#ifdef __MINGW32__ #ifdef __MINGW32__
// Require Windows XP or higher with MinGW for getaddrinfo(). // Require Windows XP or higher with MinGW for getaddrinfo().
#if(_WIN32_WINNT >= 0x0600) #if(_WIN32_WINNT >= 0x0501)
#else #else
#undef _WIN32_WINNT #error You need at least Windows XP target
#define _WIN32_WINNT 0x0600
#endif #endif
#endif #endif
......
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