Correct check for <windows.h> 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
042d922e88 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.
This commit is contained in:
Vadim Zeitlin
2018-01-23 17:53:18 +01:00
parent 0d77df8af1
commit 9364690c0e

View File

@@ -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 */