[glib: 1/2] Fix arch detection ifdefs in glib/valgrind.h



commit af0e0cb9950569828e68f5ee87dd48cd17b0a5a5
Author: Martin Storsjö <martin martin st>
Date:   Tue Mar 31 23:09:54 2020 +0300

    Fix arch detection ifdefs in glib/valgrind.h
    
    Don't assume that __MINGW32__ implies x86; Windows runs on ARM/ARM64
    as well, and there are mingw toolchains that target those architectures.
    
    This mirrors how the MSVC part of the same expressions are written,
    as (defined(_WIN32) && defined(_M_IX86)) and
    (defined(_WIN64) && defined(_M_X64)) - not relying on _WIN32/_WIN64
    or __MINGW32__/__MINGW64__ alone to indicate architecture.

 glib/valgrind.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/valgrind.h b/glib/valgrind.h
index 5aed0dfca..30ccceb0a 100644
--- a/glib/valgrind.h
+++ b/glib/valgrind.h
@@ -130,11 +130,11 @@
 #  define PLAT_x86_darwin 1
 #elif defined(__APPLE__) && defined(__x86_64__)
 #  define PLAT_amd64_darwin 1
-#elif (defined(__MINGW32__) && !defined(__MINGW64__)) \
+#elif (defined(__MINGW32__) && defined(__i386__)) \
       || defined(__CYGWIN32__) \
       || (defined(_WIN32) && defined(_M_IX86))
 #  define PLAT_x86_win32 1
-#elif defined(__MINGW64__) \
+#elif (defined(__MINGW64__) && defined(__x86_64__)) \
       || (defined(_WIN64) && defined(_M_X64))
 #  define PLAT_amd64_win64 1
 #elif defined(__linux__) && defined(__i386__)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]