From 9364690c0e2b589c5ea30793fe19884563c348bb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Jan 2018 17:53:18 +0100 Subject: [PATCH] Correct check for inclusion to fix MinGW build MinGW compiler predefines WIN32, meaning that wx/msw/winundef.h was always included from wx/defs.h, even when it was completely unnecessary. This was just inefficient, but harmless, until the changes of 042d922e88da988875d043b837dc548eb4b930b0 which broke MinGW compilation as wxUSE_UNICODE_WINDOWS_H was incorrectly defined during the very first inclusion of wx/msw/winundef.h, before _UNICODE could be defined correctly by windows.h. Fix this by checking whether windows.h was really already included. --- include/wx/defs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index b1d11474a0..98bb7244bf 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -26,10 +26,10 @@ */ #ifdef __cplusplus /* - Test for WIN32, defined by windows.h itself, not our own __WINDOWS__, - which is not defined yet. + Test for _WINDOWS_, used as header guard by windows.h itself, not our + own __WINDOWS__, which is not defined yet. */ -# ifdef WIN32 +# ifdef _WINDOWS_ # include "wx/msw/winundef.h" # endif /* WIN32 */ #endif /* __cplusplus */