From fee0decbb018e253cfa43fb316c9f64ed5370036 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 4 Jan 2019 23:48:36 +0100 Subject: [PATCH] Apply g++ 4.7 workaround in hash set macros to this compiler only This workaround was already disabled for MSVC, as it resulted in a warning there, but it also gives a similar warning with clang and it seems better to restrict this workaround to gcc only rather than excluding another compiler. --- include/wx/hashset.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/wx/hashset.h b/include/wx/hashset.h index 38a65ab5f4..82e0d252f5 100644 --- a/include/wx/hashset.h +++ b/include/wx/hashset.h @@ -75,13 +75,13 @@ public: \ // the names of the hasher and comparator classes are interpreted as naming // the base class which is inaccessible. // The workaround is to prefix the class names with 'struct'; however, don't -// do this on MSVC because it causes a warning there if the class was -// declared as a 'class' rather than a 'struct' (and MSVC's std::unordered_set -// implementation does not suffer from the access problem). -#ifdef _MSC_VER -#define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) STRUCTNAME -#else +// do this unconditionally, as with other compilers (both MSVC and clang) +// doing it causes a warning if the class was declared as a 'class' rather than +// a 'struct'. +#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 7) #define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) struct STRUCTNAME +#else +#define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) STRUCTNAME #endif #define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP ) \