Commit 5aad2f56 authored by Stefan Behnel's avatar Stefan Behnel

Simplify preprocessor code that avoids the "fallthrough" C compiler warnings,...

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.
parent 207d694a
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment