From 4ec80a35f97044dde2616505226a09ccbe20150c Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 17 Oct 2017 09:21:03 -0700 Subject: [PATCH] Define wxFALLTHROUGH for more compilers Avoids -Wimplicit-fallthrough warning with GCC 7 --- include/wx/defs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 4cee732ff6..bdf417e3ce 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -287,10 +287,12 @@ typedef short int WXTYPE; /* wxFALLTHROUGH is used to notate explicit fallthroughs in switch statements */ -#if __cplusplus >= 201103L && defined(__has_warning) - #if WX_HAS_CLANG_FEATURE(cxx_attributes) - #define wxFALLTHROUGH [[clang::fallthrough]] - #endif +#if __cplusplus >= 201703L + #define wxFALLTHROUGH [[fallthrough]] +#elif __cplusplus >= 201103L && defined(__has_warning) && WX_HAS_CLANG_FEATURE(cxx_attributes) + #define wxFALLTHROUGH [[clang::fallthrough]] +#elif wxCHECK_GCC_VERSION(7, 0) + #define wxFALLTHROUGH __attribute__ ((fallthrough)) #endif #ifndef wxFALLTHROUGH