3 #ifndef __ZMQ_WINDOWS_HPP_INCLUDED__
4 #define __ZMQ_WINDOWS_HPP_INCLUDED__
6 #ifndef _CRT_SECURE_NO_WARNINGS
7 #define _CRT_SECURE_NO_WARNINGS
10 #define NOMINMAX // Macros min(a,b) and max(a,b)
15 #if !defined _WIN32_WINNT && !defined ZMQ_HAVE_WINDOWS_UWP
16 #define _WIN32_WINNT 0x0600
21 #if (_WIN32_WINNT >= 0x0501)
23 #error You need at least Windows XP target
34 #if !defined __MINGW32__
40 #if defined __MINGW32__ && !defined SIO_KEEPALIVE_VALS \
41 && !defined __MINGW64_VERSION_MAJOR
46 u_long keepaliveinterval;
48 #define SIO_KEEPALIVE_VALS _WSAIOW (IOC_VENDOR, 4)
53 #if !defined _WIN32_WCE
57 #if defined ZMQ_IOTHREAD_POLLER_USE_POLL || defined ZMQ_POLL_BASED_ON_POLL
58 static inline int poll (
struct pollfd *pfd,
unsigned long nfds,
int timeout)
60 return WSAPoll (pfd, nfds,
timeout);
65 #ifndef AI_NUMERICSERV
66 #define AI_NUMERICSERV 0x0400
74 if (utf8_string && *utf8_string) {
75 const int utf16_length = ::MultiByteToWideChar (
76 CP_UTF8, MB_ERR_INVALID_CHARS, utf8_string,
80 if (utf16_length > 0) {
81 retVal.resize (utf16_length);
83 const int conversion_result = ::MultiByteToWideChar (
84 CP_UTF8, MB_ERR_INVALID_CHARS, utf8_string,
86 &retVal[0],
static_cast<int> (retVal.size ()));
88 if (conversion_result == 0)
108 #if defined(_MSC_VER) && _MSC_VER < 1900
109 #define snprintf(buffer_, count_, format_, ...) \
110 _snprintf_s (buffer_, count_, _TRUNCATE, format_, __VA_ARGS__)
115 #if defined(ZMQ_HAVE_IPC) && !defined(ZMQ_HAVE_STRUCT_SOCKADDR_UN)
118 ADDRESS_FAMILY sun_family;