windows.hpp 4.63 KB
Newer Older
Martin Sustrik's avatar
Martin Sustrik committed
1
/*
2
    Copyright (c) 2007-2013 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
//  The purpose of this header file is to turn on only the items actually
//  needed on the windows platform.
Martin Sustrik's avatar
Martin Sustrik committed
25

26 27 28
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
Martin Sustrik's avatar
Martin Sustrik committed
29 30 31
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
32 33
#ifndef NOGDICAPMASKS
#define NOGDICAPMASKS     // CC_*, LC_*, PC_*, CP_*, TC_*, RC_
Martin Sustrik's avatar
Martin Sustrik committed
34
#endif
35 36
#ifndef NOVIRTUALKEYCODES
#define NOVIRTUALKEYCODES // VK_*
Martin Sustrik's avatar
Martin Sustrik committed
37
#endif
38 39
#ifndef NOWINMESSAGES
#define NOWINMESSAGES     // WM_*, EM_*, LB_*, CB_*
Martin Sustrik's avatar
Martin Sustrik committed
40
#endif
41 42
#ifndef NOWINSTYLES
#define NOWINSTYLES       // WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
Martin Sustrik's avatar
Martin Sustrik committed
43
#endif
44 45
#ifndef NOSYSMETRICS
#define NOSYSMETRICS      // SM_*
malosek's avatar
malosek committed
46
#endif
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
#ifndef NOMENUS
#define NOMENUS           // MF_*
#endif
#ifndef NOICONS
#define NOICONS           // IDI_*
#endif
#ifndef NOKEYSTATES
#define NOKEYSTATES       // MK_*
#endif
#ifndef NOSYSCOMMANDS
#define NOSYSCOMMANDS     // SC_*
#endif
#ifndef NORASTEROPS
#define NORASTEROPS       // Binary and Tertiary raster ops
#endif
#ifndef NOSHOWWINDOW
#define NOSHOWWINDOW      // SW_*
#endif
#ifndef OEMRESOURCE
#define OEMRESOURCE       // OEM Resource values
#endif
#ifndef NOATOM
#define NOATOM            // Atom Manager routines
#endif
#ifndef NOCLIPBOARD
#define NOCLIPBOARD       // Clipboard routines
#endif
#ifndef NOCOLOR
#define NOCOLOR           // Screen colors
#endif
#ifndef NOCTLMGR
#define NOCTLMGR          // Control and Dialog routines
#endif
#ifndef NODRAWTEXT
#define NODRAWTEXT        // DrawText() and DT_*
#endif
#ifndef NOGDI
#define NOGDI             // All GDI defines and routines
#endif
#ifndef NOKERNEL
#define NOKERNEL          // All KERNEL defines and routines
#endif
#ifndef NOUSER
#define NOUSER            // All USER defines and routines
#endif
#ifndef NONLS
#define NONLS             // All NLS defines and routines
#endif
#ifndef NOMB
#define NOMB              // MB_* and MessageBox()
#endif
#ifndef NOMEMMGR
#define NOMEMMGR          // GMEM_*, LMEM_*, GHND, LHND, associated routines
#endif
#ifndef NOMETAFILE
#define NOMETAFILE        // typedef METAFILEPICT
#endif
#ifndef NOMINMAX
#define NOMINMAX          // Macros min(a,b) and max(a,b)
#endif
#ifndef NOMSG
#define NOMSG             // typedef MSG and associated routines
#endif
#ifndef NOOPENFILE
#define NOOPENFILE        // OpenFile(), OemToAnsi, AnsiToOem, and OF_*
#endif
#ifndef NOSCROLL
#define NOSCROLL          // SB_* and scrolling routines
#endif
#ifndef NOSERVICE
#define NOSERVICE         // All Service Controller routines, SERVICE_ equates, etc.
#endif
#ifndef NOSOUND
#define NOSOUND           // Sound driver routines
#endif
#ifndef NOTEXTMETRIC
#define NOTEXTMETRIC      // typedef TEXTMETRIC and associated routines
#endif
#ifndef NOWH
#define NOWH              // SetWindowsHook and WH_*
#endif
#ifndef NOWINOFFSETS
#define NOWINOFFSETS      // GWL_*, GCL_*, associated routines
#endif
#ifndef NOCOMM
#define NOCOMM            // COMM driver routines
#endif
#ifndef NOKANJI
#define NOKANJI           // Kanji support stuff.
#endif
#ifndef NOHELP
#define NOHELP            // Help engine interface.
#endif
#ifndef NOPROFILER
#define NOPROFILER        // Profiler interface.
#endif
#ifndef NODEFERWINDOWPOS
#define NODEFERWINDOWPOS  // DeferWindowPos routines
#endif
#ifndef NOMCX
#define NOMCX             // Modem Configuration ExtensionsA
malosek's avatar
malosek committed
148 149
#endif

150
//  Set target version to Windows Server 2003, Windows XP/SP1 or higher.
151
#ifndef _WIN32_WINNT
152
#define _WIN32_WINNT 0x0501
153 154
#endif

155 156 157 158 159
#include <windows.h>

#ifdef __MINGW32__
//  Require Windows XP or higher with MinGW for getaddrinfo().
#if(_WIN32_WINNT >= 0x0501)
Martin Sustrik's avatar
Martin Sustrik committed
160
#else
161 162 163
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
Martin Sustrik's avatar
Martin Sustrik committed
164
#endif
165 166 167
 
#include <winsock2.h>
#include <mswsock.h>
Martin Sustrik's avatar
Martin Sustrik committed
168 169 170

#include <ws2tcpip.h>
#include <ipexport.h>
171
#if !defined _WIN32_WCE
Martin Sustrik's avatar
Martin Sustrik committed
172
#include <process.h>
boris@boressoft.ru's avatar
boris@boressoft.ru committed
173
#endif
Martin Sustrik's avatar
Martin Sustrik committed
174

175
//  In MinGW environment AI_NUMERICSERV is not defined.
176 177 178
#ifndef AI_NUMERICSERV
#define AI_NUMERICSERV 0x0400
#endif
Martin Sustrik's avatar
Martin Sustrik committed
179
#endif