mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-19 16:56:11 +01:00
Merge pull request #2619 from diorcety/winxp
Partial Windows XP support
This commit is contained in:
commit
cb266ee073
@ -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 @@
|
|||||||
#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
|
|||||||
|
|
||||||
#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
|
|||||||
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 @@
|
|||||||
|
|
||||||
#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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user