From e37f1a84ce3ab3062cb00eafd86a8fe9acd088bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Wed, 23 Mar 2016 14:41:33 +0100 Subject: [PATCH] Disable warnings in the standard shlobj.h header with MSVC14 There is nothing we can do about these (harmless) warnings, so just disable them. Also make sure that the header is included via wx/msw/wrapshl.h everywhere. --- include/wx/msw/wrapshl.h | 13 +++++++++++++ src/common/filename.cpp | 2 +- src/msw/mimetype.cpp | 2 +- src/msw/ole/dataobj.cpp | 2 +- src/msw/ole/droptgt.cpp | 2 +- src/msw/volume.cpp | 2 +- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/include/wx/msw/wrapshl.h b/include/wx/msw/wrapshl.h index aa32ca9964..e0470242ae 100644 --- a/include/wx/msw/wrapshl.h +++ b/include/wx/msw/wrapshl.h @@ -13,8 +13,21 @@ #include "wx/msw/wrapwin.h" +#ifdef __VISUALC__ + // Disable a warning that we can do nothing about: we get it for + // shlobj.h at least from 7.1a Windows kit when using VC14. + #pragma warning(push) + + // 'typedef ': ignored on left of '' when no variable is declared + #pragma warning(disable:4091) +#endif + #include +#ifdef __VISUALC__ + #pragma warning(pop) +#endif + #include "wx/msw/winundef.h" #include "wx/log.h" diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 18b9c3dafb..c749cc4082 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -100,7 +100,7 @@ #ifdef __WINDOWS__ #include "wx/msw/private.h" - #include // for CLSID_ShellLink + #include "wx/msw/wrapshl.h" // for CLSID_ShellLink #include "wx/msw/missing.h" #include "wx/msw/ole/oleutils.h" #include "wx/msw/private/comptr.h" diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index 380a2807ed..d0609ef89c 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -40,7 +40,7 @@ #include "wx/msw/registry.h" #include "wx/msw/private.h" #include - #include + #include "wx/msw/wrapshl.h" // For MSVC we can link in the required library explicitly, for the other // compilers (e.g. MinGW) this needs to be done at makefiles level. diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 06b4440bbd..fbc5362ac8 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -39,7 +39,7 @@ #include "wx/msw/private.h" // includes #include -#include +#include "wx/msw/wrapshl.h" #include "wx/msw/ole/oleutils.h" diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index 170254b9ab..237ab42c91 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -32,7 +32,7 @@ #include "wx/msw/private.h" -#include // for DROPFILES structure +#include "wx/msw/wrapshl.h" // for DROPFILES structure #include "wx/dnd.h" diff --git a/src/msw/volume.cpp b/src/msw/volume.cpp index eb639084f4..a2932bf3d4 100644 --- a/src/msw/volume.cpp +++ b/src/msw/volume.cpp @@ -44,7 +44,7 @@ // even if this is not necessary with most of them #include "wx/msw/wrapwin.h" #include -#include +#include "wx/msw/wrapshl.h" #include "wx/msw/missing.h" #if wxUSE_BASE