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.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user