diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2011-01-30 19:56:46 -0500 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2011-01-30 19:56:46 -0500 |
commit | 91812df4ed0facfb90bec3f9430dd5a97d56f695 (patch) | |
tree | 09e3d6d3f5ee3cfe1e4884b373b1271574153ad6 /src/include/port/win32.h | |
parent | 9688c4e6f1516d2fc0db5d200112c4d91538878d (diff) |
Enable building with the Mingw64 compiler.
This can be used to build 64 bit Windows binaries, not only on 64 bit
Windows but on supported cross-compiling hosts including 32 bit Windows,
Cygwin, Darwin and Linux.
Diffstat (limited to 'src/include/port/win32.h')
-rw-r--r-- | src/include/port/win32.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h index 93439f763d0..6d99ecbe88d 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -4,7 +4,16 @@ #define WIN32_ONLY_COMPILER #endif +/* + * Make sure _WIN32_WINNT has the minumum required value. + * Leave a higher value in place. +*/ +#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0501 +#undefine _WIN32_WINNT +#endif +#ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 +#endif /* * Always build with SSPI support. Keep it as a #define in case * we want a switch to disable it sometime in the future. @@ -17,10 +26,17 @@ #undef mkdir #undef ERROR + +/* + * The Mingw64 headers choke if this is already defined - they + * define it themselves. + */ +#if !defined(WIN64) || defined(WIN32_ONLY_COMPILER) #define _WINSOCKAPI_ -#include <windows.h> +#endif #include <winsock2.h> #include <ws2tcpip.h> +#include <windows.h> #undef small #include <process.h> #include <signal.h> |