gwin32: Fix detection of MinGW32 vs MinGW-w64

__MINGW32__ is defined on all MinGW variants including MinGW-w64.
__MINGW64_VERSION_MAJOR is only defined on MinGW-w64.

This difference is important because on MinGW-w64 we must #include
winternl.h because including ntdef.h results in compiler errors
about symbol redefinition, and the header warns that it is deprecated
and may be removed in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=795849
This commit is contained in:
Nirbheek Chauhan 2018-05-06 15:29:09 +05:30 committed by Philip Withnall
parent ab0a0c706c
commit a9fe62aa2c

View File

@ -59,8 +59,8 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma comment (lib, "ntoskrnl.lib") #pragma comment (lib, "ntoskrnl.lib")
#endif #endif
#elif defined (__MINGW32__) #elif defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
/* mingw-w64, not MinGW, has winternl.h */ /* mingw-w64 must use winternl.h, but not MinGW */
#include <ntdef.h> #include <ntdef.h>
#else #else
#include <winternl.h> #include <winternl.h>