[glib] gwin32: Fix detection of MinGW32 vs MinGW-w64
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gwin32: Fix detection of MinGW32 vs MinGW-w64
- Date: Wed, 16 May 2018 10:08:13 +0000 (UTC)
commit a9fe62aa2cfcf3fb3c8223f31ccb8936784c85eb
Author: Nirbheek Chauhan <nirbheek centricular com>
Date: Sun May 6 15:29:09 2018 +0530
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
glib/gwin32.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/gwin32.c b/glib/gwin32.c
index cc6da5f99..a176514b1 100644
--- a/glib/gwin32.c
+++ b/glib/gwin32.c
@@ -59,8 +59,8 @@
#ifdef _MSC_VER
#pragma comment (lib, "ntoskrnl.lib")
#endif
-#elif defined (__MINGW32__)
-/* mingw-w64, not MinGW, has winternl.h */
+#elif defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
+/* mingw-w64 must use winternl.h, but not MinGW */
#include <ntdef.h>
#else
#include <winternl.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]