diff options
author | Lisandro Dalcin <dalcinl@gmail.com> | 2017-10-15 11:37:55 +0300 |
---|---|---|
committer | Lisandro Dalcin <dalcinl@gmail.com> | 2017-10-15 14:17:10 +0300 |
commit | 7f7f7b187713c2a05d8eeed39b056b80511be468 (patch) | |
tree | b8d0b9f207bca2e9049393a6985f6e600b7ea3e5 | |
parent | 206e95f27137165e450771c38845c72457c16344 (diff) | |
download | cython-7f7f7b187713c2a05d8eeed39b056b80511be468.tar.gz |
Fix definition CYTHON_FALLTHROUGH in module setup utility code
-rw-r--r-- | Cython/Utility/ModuleSetupCode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index e243dddb3..043cd7206 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -512,16 +512,25 @@ #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH - #if (defined(__GNUC__) || defined(__clang__)) && __has_attribute(fallthrough) + #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif + + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 /* Xcode < 7.0 */ + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif #endif /////////////// CInitCode /////////////// |