From e744317d3a772fe6710677456135ea7db2f4c8d6 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. (backported from commit e37f1a84ce3ab3062cb00eafd86a8fe9acd088bc) --- include/wx/msw/wrapshl.h | 13 +++++++++++++ src/common/filename.cpp | 2 +- src/msw/ole/dataobj.cpp | 2 +- src/msw/ole/droptgt.cpp | 2 +- src/msw/volume.cpp | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/wx/msw/wrapshl.h b/include/wx/msw/wrapshl.h index 8826a039ba..dbcc612467 100644 --- a/include/wx/msw/wrapshl.h +++ b/include/wx/msw/wrapshl.h @@ -20,8 +20,21 @@ #include #endif +#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 c2959ace94..8dc47fdb44 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" #endif diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 2055a0a0de..20a37970ad 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -48,7 +48,7 @@ #endif #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 45b67c3c16..ba5aa41775 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -39,7 +39,7 @@ #ifdef __WIN32__ #if !defined(__GNUWIN32__) || wxUSE_NORLANDER_HEADERS - #include // for DROPFILES structure + #include "wx/msw/wrapshl.h" // for DROPFILES structure #endif #else #include 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