diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2017-10-14 07:38:05 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2017-10-14 07:38:05 +0200 |
commit | 5aad2f56499450a938528490d7c88e0990152a17 (patch) | |
tree | 6e8d55796665e1efeb11e136681b6ab43d00288e | |
parent | 207d694ac2a580f02b28e216d0843308f5ad129b (diff) | |
download | cython-5aad2f56499450a938528490d7c88e0990152a17.tar.gz |
Simplify preprocessor code that avoids the "fallthrough" C compiler warnings, assuming that "__has_attribute()" is widely supported these days. At least GCC 5.x and clang seem to have it.
Closes #1930.
-rw-r--r-- | Cython/Utility/ModuleSetupCode.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index 214ccdebf..951a59b67 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -516,9 +516,7 @@ #endif #ifndef CYTHON_FALLTHROUGH - #if defined(__clang__) && __has_attribute(fallthrough) - #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) - #elif defined(__GNUC__) && defined(__attribute__) + #if !defined(_MSC_VER) && __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH |