From baf67813b0f6048a370d37230be6d44272ee00ff Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 12 Feb 2016 02:20:44 +0100 Subject: [PATCH] Fix redefinition errors in wxTaskBarButton code with MSVC After 4475fe36a54cd62457dcd73c8739b1e7d46e1cde there were ambiguities between PROPERTYKEY and PROPVARIANT defined in the anonymous namespace and the global header for the compilers that did define them, such as MSVC. Fix this by not (re)defining PROPERTYKEY if it had been already defined and not defining PROPVARIANT at all as it's used as PropVariantClear() parameter in the beginning of this file, before it was defined by us, so it must work for all the compilers already anyhow. --- src/msw/taskbarbutton.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/msw/taskbarbutton.cpp b/src/msw/taskbarbutton.cpp index 2be7e723d8..de4bc3a566 100644 --- a/src/msw/taskbarbutton.cpp +++ b/src/msw/taskbarbutton.cpp @@ -126,17 +126,16 @@ typedef enum TBPFLAG TBPF_PAUSED = 0x8 } TBPFLAG; +#ifndef PROPERTYKEY_DEFINED typedef struct _tagpropertykey { GUID fmtid; DWORD pid; } PROPERTYKEY; +#endif // !PROPERTYKEY_DEFINED #define REFPROPERTYKEY const PROPERTYKEY & -typedef struct tagPROPVARIANT PROPVARIANT; -#define REFPROPVARIANT const PROPVARIANT & - #define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) \ const PROPERTYKEY name = \ { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid } @@ -292,7 +291,7 @@ public: virtual HRESULT wxSTDCALL GetCount(DWORD *) = 0; virtual HRESULT wxSTDCALL GetAt(DWORD, PROPERTYKEY *) = 0; virtual HRESULT wxSTDCALL GetValue(REFPROPERTYKEY, PROPVARIANT *) = 0; - virtual HRESULT wxSTDCALL SetValue(REFPROPERTYKEY, REFPROPVARIANT) = 0; + virtual HRESULT wxSTDCALL SetValue(REFPROPERTYKEY, const PROPVARIANT&) = 0; virtual HRESULT wxSTDCALL Commit() = 0; };