0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-22 07:29:31 +08:00
libzmq/src/windows.hpp

74 lines
2.0 KiB
C++
Raw Normal View History

2009-07-29 12:07:54 +02:00
/*
2014-01-02 12:00:57 +01:00
Copyright (c) 2007-2014 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
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
GNU Lesser General Public License for more details.
2009-07-29 12:07:54 +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
#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
// Set target version to Windows Server 2003, Windows XP/SP1 or higher.
2009-11-03 14:06:25 +01:00
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
2009-11-03 14:06:25 +01:00
#endif
#ifdef __MINGW32__
// Require Windows XP or higher with MinGW for getaddrinfo().
#if(_WIN32_WINNT >= 0x0501)
2009-07-29 12:07:54 +02:00
#else
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
2009-07-29 12:07:54 +02:00
#endif
#include <winsock2.h>
2014-01-13 18:38:59 +08:00
#include <windows.h>
#include <mswsock.h>
2014-01-13 18:38:59 +08:00
#if !defined __MINGW32__
#include <Mstcpip.h>
2014-01-13 18:38:59 +08:00
#endif
2009-07-29 12:07:54 +02: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
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>
#if !defined _WIN32_WCE
2009-07-29 12:07:54 +02:00
#include <process.h>
#endif
2009-07-29 12:07:54 +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