From bdb7453c7b80c23f0fb4890cad4ba5f6d0a5ca7c Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 31 Mar 2014 15:28:55 +0000 Subject: [PATCH] adding wxFALLTHROUGH to indicate intended fall through in switch statements git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76236 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/wx/defs.h b/include/wx/defs.h index d29084339d..7d38217942 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -299,6 +299,18 @@ typedef short int WXTYPE; #define wxOVERRIDE #endif /* HAVE_OVERRIDE/!HAVE_EXPLICIT */ +/* 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 +#endif + +#ifndef wxFALLTHROUGH + #define wxFALLTHROUGH ((void)0) +#endif + /* these macros are obsolete, use the standard C++ casts directly now */ #define wx_static_cast(t, x) static_cast(x) #define wx_const_cast(t, x) const_cast(x)