From 3b298cc8b2a22fca0aed1d457512738bf11e3bbb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 20 Mar 2017 00:26:10 +0100 Subject: [PATCH] Only define wxCLANG_WARNING_SUPPRESS/RESTORE when using clang This makes sense and avoids an error if some other header sabotages our __has_warning definition check by providing a dummy definition for it (as ICU does, for whatever reason). --- include/wx/defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 3fe0c11b99..f21937cd23 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -641,7 +641,7 @@ typedef short int WXTYPE; virtual wxClassInfo *GetClassInfo() const wxCLANG_WARNING_RESTORE(inconsistent-missing-override) */ -#if defined(__has_warning) +#if defined(__clang__) && defined(__has_warning) # define wxCLANG_HAS_WARNING(x) __has_warning(x) /* allow macro expansion for the warning name */ # define wxCLANG_IF_VALID_WARNING(x,y) \ wxCONCAT(wxCLANG_IF_VALID_WARNING_,wxCLANG_HAS_WARNING(wxSTRINGIZE(wxCONCAT(-W,x))))(y)