Windows: actually detect mingw-w64 and not 64 bits mode

__MINGW64__ is only defined when using mingw-w64 in 64bits mode, not when
using the 32bits version of the compiler.

Instead, to detect usage of mingw-w64 instead of mingw version of GCC we
should look at __MINGW64_VERSION_MAJOR and __MINGW64_VERSION_MINOR. If one
of these is defined means we are running on mingw-w64 compiler and headers
and not mingw.org build.

Read more here: http://bit.ly/detect-mingw-w64-vs-mingw

Closes #384
This commit is contained in:
Luis Lavena 2012-04-25 04:06:06 +02:00 committed by Bert Belder
parent 42a86693a7
commit b6e3dcc799
2 changed files with 4 additions and 4 deletions

View File

@ -4079,8 +4079,8 @@
(FACILITY_NTWIN32 << 16) | ERROR_SEVERITY_WARNING)))
/* from ntifs.h */
/* MinGW already has it */
#if defined(_MSC_VER) || defined(__MINGW64__)
/* MinGW already has it, mingw-w64 does not. */
#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
typedef struct _REPARSE_DATA_BUFFER {
ULONG ReparseTag;
USHORT ReparseDataLength;
@ -4335,7 +4335,7 @@ typedef NTSTATUS (NTAPI *sNtSetInformationFile)
# define SYMBOLIC_LINK_FLAG_DIRECTORY 0x1
#endif
#ifdef __MINGW32__
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
typedef struct _OVERLAPPED_ENTRY {
ULONG_PTR lpCompletionKey;
LPOVERLAPPED lpOverlapped;

View File

@ -112,7 +112,7 @@ typedef struct _AFD_RECV_INFO {
#define IOCTL_AFD_RECEIVE_DATAGRAM \
_AFD_CONTROL_CODE(AFD_RECEIVE_DATAGRAM, METHOD_NEITHER)
#if defined(__MINGW32__) && !defined(__MINGW64__)
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
typedef struct _IP_ADAPTER_UNICAST_ADDRESS_XP {
/* FIXME: __C89_NAMELESS was removed */