windows.hpp 1.65 KB
Newer Older
Martin Sustrik's avatar
Martin Sustrik committed
1
/*
2
    Copyright (c) 2007-2014 Contributors as noted in the AUTHORS file
Martin Sustrik's avatar
Martin Sustrik committed
3 4 5 6

    This file is part of 0MQ.

    0MQ is free software; you can redistribute it and/or modify it under
7
    the terms of the GNU Lesser General Public License as published by
Martin Sustrik's avatar
Martin Sustrik committed
8 9 10 11 12 13
    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
14
    GNU Lesser General Public License for more details.
Martin Sustrik's avatar
Martin Sustrik committed
15

16
    You should have received a copy of the GNU Lesser General Public License
Martin Sustrik's avatar
Martin Sustrik committed
17 18 19
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

Martin Sustrik's avatar
Martin Sustrik committed
20 21
#ifndef __ZMQ_WINDOWS_HPP_INCLUDED__
#define __ZMQ_WINDOWS_HPP_INCLUDED__
Martin Sustrik's avatar
Martin Sustrik committed
22

23 24 25
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
26 27 28
#ifndef NOMINMAX
#define NOMINMAX          // Macros min(a,b) and max(a,b)
#endif
malosek's avatar
malosek committed
29

30
//  Set target version to Windows Server 2003, Windows XP/SP1 or higher.
31
#ifndef _WIN32_WINNT
32
#define _WIN32_WINNT 0x0501
33 34
#endif

35 36 37
#ifdef __MINGW32__
//  Require Windows XP or higher with MinGW for getaddrinfo().
#if(_WIN32_WINNT >= 0x0501)
Martin Sustrik's avatar
Martin Sustrik committed
38
#else
39 40 41
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
Martin Sustrik's avatar
Martin Sustrik committed
42
#endif
43 44
 
#include <winsock2.h>
45
#include <windows.h>
46
#include <mswsock.h>
47 48

#if !defined __MINGW64_VERSION_MAJOR && !defined __MINGW64_VERSION_MINOR
49
#include <Mstcpip.h>
50
#endif
Martin Sustrik's avatar
Martin Sustrik committed
51 52 53

#include <ws2tcpip.h>
#include <ipexport.h>
54
#if !defined _WIN32_WCE
Martin Sustrik's avatar
Martin Sustrik committed
55
#include <process.h>
boris@boressoft.ru's avatar
boris@boressoft.ru committed
56
#endif
Martin Sustrik's avatar
Martin Sustrik committed
57

58
//  In MinGW environment AI_NUMERICSERV is not defined.
59 60 61
#ifndef AI_NUMERICSERV
#define AI_NUMERICSERV 0x0400
#endif
Martin Sustrik's avatar
Martin Sustrik committed
62
#endif