From 1a9900a81340b3b509ec2e904667f3538bca4e3d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Apr 2017 00:02:21 +0200 Subject: [PATCH] Fix warning about undefined __cplusplus in wx/defs.h Check that __cplusplus is defined before testing its value to avoid warnings when compiling C code, e.g. regex library. Notice that in master a check for __cplusplus covering a bigger part of this file was added to solve the same problem, but it doesn't seem like a good idea to stop defining other symbols which had been previously defined in 3.0, so keep this check as narrow as possible here. --- include/wx/defs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 21345abe41..eb9c29afa8 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -277,12 +277,13 @@ typedef short int WXTYPE; #endif /* HAVE_EXPLICIT/!HAVE_EXPLICIT */ /* wxFALLTHROUGH is used to notate explicit fallthroughs in switch statements */ - +#ifdef __cplusplus #if __cplusplus >= 201103L && defined(__has_warning) #if WX_HAS_CLANG_FEATURE(cxx_attributes) #define wxFALLTHROUGH [[clang::fallthrough]] #endif #endif +#endif /* __cplusplus */ #ifndef wxFALLTHROUGH #define wxFALLTHROUGH ((void)0)