2009-07-29 12:07:54 +02:00
|
|
|
/*
|
2015-01-22 10:32:06 +01:00
|
|
|
Copyright (c) 2007-2015 Contributors as noted in the AUTHORS file
|
2009-07-29 12:07:54 +02:00
|
|
|
|
|
|
|
This file is part of 0MQ.
|
|
|
|
|
|
|
|
0MQ is free software; you can redistribute it and/or modify it under
|
2010-10-30 15:08:28 +02:00
|
|
|
the terms of the GNU Lesser General Public License as published by
|
2009-07-29 12:07:54 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
0MQ is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2010-10-30 15:08:28 +02:00
|
|
|
GNU Lesser General Public License for more details.
|
2009-07-29 12:07:54 +02:00
|
|
|
|
2010-10-30 15:08:28 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2009-07-29 12:07:54 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2009-08-03 11:30:13 +02:00
|
|
|
#ifndef __ZMQ_WINDOWS_HPP_INCLUDED__
|
|
|
|
#define __ZMQ_WINDOWS_HPP_INCLUDED__
|
2009-07-29 12:07:54 +02:00
|
|
|
|
2011-12-15 14:03:43 +01:00
|
|
|
#ifndef _CRT_SECURE_NO_WARNINGS
|
|
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
|
|
#endif
|
2014-01-14 10:27:40 +00:00
|
|
|
#ifndef NOMINMAX
|
|
|
|
#define NOMINMAX // Macros min(a,b) and max(a,b)
|
|
|
|
#endif
|
2009-10-05 15:06:40 +02:00
|
|
|
|
2011-06-18 20:44:03 +02:00
|
|
|
// Set target version to Windows Server 2003, Windows XP/SP1 or higher.
|
2009-11-03 14:06:25 +01:00
|
|
|
#ifndef _WIN32_WINNT
|
2011-06-18 20:44:03 +02:00
|
|
|
#define _WIN32_WINNT 0x0501
|
2009-11-03 14:06:25 +01:00
|
|
|
#endif
|
|
|
|
|
2011-06-18 20:44:03 +02:00
|
|
|
#ifdef __MINGW32__
|
|
|
|
// Require Windows XP or higher with MinGW for getaddrinfo().
|
|
|
|
#if(_WIN32_WINNT >= 0x0501)
|
2009-07-29 12:07:54 +02:00
|
|
|
#else
|
2011-06-18 20:44:03 +02:00
|
|
|
#undef _WIN32_WINNT
|
|
|
|
#define _WIN32_WINNT 0x0501
|
|
|
|
#endif
|
2009-07-29 12:07:54 +02:00
|
|
|
#endif
|
2011-06-18 20:44:03 +02:00
|
|
|
|
|
|
|
#include <winsock2.h>
|
2014-01-13 18:38:59 +08:00
|
|
|
#include <windows.h>
|
2011-06-18 20:44:03 +02:00
|
|
|
#include <mswsock.h>
|
2014-01-13 18:38:59 +08:00
|
|
|
|
2014-02-18 21:24:24 +08:00
|
|
|
#if !defined __MINGW32__
|
2013-12-22 02:55:18 +02:00
|
|
|
#include <Mstcpip.h>
|
2014-01-13 18:38:59 +08:00
|
|
|
#endif
|
2009-07-29 12:07:54 +02:00
|
|
|
|
2014-03-20 12:22:15 -04:00
|
|
|
// Workaround missing Mstcpip.h in mingw32 (MinGW64 provides this)
|
2014-04-14 13:56:01 +02:00
|
|
|
// __MINGW64_VERSION_MAJOR is only defined when using in mingw-w64
|
|
|
|
#if defined __MINGW32__ && !defined SIO_KEEPALIVE_VALS && !defined __MINGW64_VERSION_MAJOR
|
2014-02-18 21:24:24 +08:00
|
|
|
struct tcp_keepalive {
|
|
|
|
u_long onoff;
|
|
|
|
u_long keepalivetime;
|
|
|
|
u_long keepaliveinterval;
|
|
|
|
};
|
|
|
|
#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4)
|
|
|
|
#endif
|
|
|
|
|
2009-07-29 12:07:54 +02:00
|
|
|
#include <ws2tcpip.h>
|
|
|
|
#include <ipexport.h>
|
2013-02-19 16:49:23 +01:00
|
|
|
#if !defined _WIN32_WCE
|
2009-07-29 12:07:54 +02:00
|
|
|
#include <process.h>
|
2012-03-14 19:12:28 +04:00
|
|
|
#endif
|
2009-07-29 12:07:54 +02:00
|
|
|
|
2011-06-18 20:44:03 +02:00
|
|
|
// In MinGW environment AI_NUMERICSERV is not defined.
|
2010-01-27 20:58:40 +01:00
|
|
|
#ifndef AI_NUMERICSERV
|
|
|
|
#define AI_NUMERICSERV 0x0400
|
|
|
|
#endif
|
2009-07-29 12:07:54 +02:00
|
|
|
#endif
|