From 13f20f154637bddadec6002081db5e3d5e0c09d5 Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Wed, 2 Oct 2024 11:57:38 +0200 Subject: [PATCH] Win32: Do not define STRICT It's defined automatically by system headers (both Windows SDK and mingw-w64) --- glib/gbacktrace.c | 7 ++----- glib/gconvert.c | 7 +------ glib/gmain.c | 3 +-- glib/gpoll.c | 1 - glib/gtimezone.c | 2 -- glib/gutf8.c | 2 -- glib/gwin32.c | 2 -- glib/tests/io-channel-basic.c | 1 - glib/win_iconv.c | 5 ++++- 9 files changed, 8 insertions(+), 22 deletions(-) diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c index 0f81502e5..ce9f4ff91 100644 --- a/glib/gbacktrace.c +++ b/glib/gbacktrace.c @@ -57,12 +57,9 @@ #include #ifdef G_OS_WIN32 -# define STRICT /* Strict typing, please */ -# define _WIN32_WINDOWS 0x0401 /* to get IsDebuggerPresent */ -# include -# undef STRICT +#include #else -# include +#include #endif #include "gbacktrace.h" diff --git a/glib/gconvert.c b/glib/gconvert.c index e0cbdcf5c..6fa5a0ff0 100644 --- a/glib/gconvert.c +++ b/glib/gconvert.c @@ -32,13 +32,8 @@ #include #ifdef G_OS_WIN32 -#include "win_iconv.c" -#endif - -#ifdef G_PLATFORM_WIN32 -#define STRICT #include -#undef STRICT +#include "win_iconv.c" #endif #include "gconvert.h" diff --git a/glib/gmain.c b/glib/gmain.c index 84ecd6102..9de145340 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -96,9 +96,8 @@ #endif /* HAVE_PIDFD */ #ifdef G_OS_WIN32 -#define STRICT #include -#endif /* G_OS_WIN32 */ +#endif #ifdef HAVE_MACH_MACH_TIME_H #include diff --git a/glib/gpoll.c b/glib/gpoll.c index cbbbe8886..44c1167cc 100644 --- a/glib/gpoll.c +++ b/glib/gpoll.c @@ -72,7 +72,6 @@ #include #ifdef G_OS_WIN32 -#define STRICT #include #include #endif /* G_OS_WIN32 */ diff --git a/glib/gtimezone.c b/glib/gtimezone.c index 2b7ed7b85..b8eaf25d9 100644 --- a/glib/gtimezone.c +++ b/glib/gtimezone.c @@ -46,8 +46,6 @@ #endif #ifdef G_OS_WIN32 - -#define STRICT #include #include #endif diff --git a/glib/gutf8.c b/glib/gutf8.c index d26a63094..dacfb12d9 100644 --- a/glib/gutf8.c +++ b/glib/gutf8.c @@ -29,9 +29,7 @@ #ifdef G_PLATFORM_WIN32 #include -#define STRICT #include -#undef STRICT #endif #include "gconvert.h" diff --git a/glib/gwin32.c b/glib/gwin32.c index d45f2464e..bbee611d3 100644 --- a/glib/gwin32.c +++ b/glib/gwin32.c @@ -41,10 +41,8 @@ #include #include -#define STRICT /* Strict typing, please */ #include #include -#undef STRICT #ifndef G_WITH_CYGWIN #include #endif diff --git a/glib/tests/io-channel-basic.c b/glib/tests/io-channel-basic.c index 695df6dad..78985e420 100644 --- a/glib/tests/io-channel-basic.c +++ b/glib/tests/io-channel-basic.c @@ -36,7 +36,6 @@ #include #include #include - #define STRICT #include #define pipe(fds) _pipe(fds, 4096, _O_BINARY) #endif diff --git a/glib/win_iconv.c b/glib/win_iconv.c index 8635c37e3..9d9a91c8d 100644 --- a/glib/win_iconv.c +++ b/glib/win_iconv.c @@ -24,7 +24,10 @@ # define WINVER 0x0500 #endif -#define STRICT +#ifndef STRICT +# define STRICT +#endif + #include #include #include