From f4d4545873d572d9921c107a6f05163c457dd31b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jun 2018 19:52:26 +0200 Subject: [PATCH] Explicitly disable all warnings from windows.h for MSVC While Windows headers compile without warnings at maximal warning level, they still contain some warnings which are disabled by default, but can be enabled explicitly, such as C4668. Make life simpler for the user code doing this by avoiding giving these warnings from the Platform SDK headers as it doesn't cost much to do this from wxMSW itself, while doing it from the user code is nontrivial. --- include/wx/msw/wrapwin.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/wx/msw/wrapwin.h b/include/wx/msw/wrapwin.h index 1bbe4f4143..e4ef98a6b6 100644 --- a/include/wx/msw/wrapwin.h +++ b/include/wx/msw/wrapwin.h @@ -34,8 +34,17 @@ #include #endif +// Disable any warnings inside Windows headers. +#ifdef __VISUALC__ + #pragma warning(push, 1) +#endif + #include +#ifdef __VISUALC__ + #pragma warning(pop) +#endif + // #undef the macros defined in winsows.h which conflict with code elsewhere #include "wx/msw/winundef.h"