include/compiler.h
raw| 1 | #if !defined(__cplusplus) || __cplusplus < 201103L |
| 2 | #define fallthrough ((void)0) |
| 3 | #else |
| 4 | #include <ciso646> |
| 5 | #ifdef _LIBCPP_VERSION |
| 6 | #ifdef _LIBCPP_FALLTHROUGH |
| 7 | #define fallthrough _LIBCPP_FALLTHROUGH() |
| 8 | #else |
| 9 | #define fallthrough [[__fallthrough__]] |
| 10 | #endif // _LIBCPP_FALLTHROUGH |
| 11 | #else |
| 12 | #ifdef __clang__ |
| 13 | #define fallthrough [[clang::fallthrough]] |
| 14 | #else |
| 15 | #define fallthrough [[gnu::fallthrough]] |
| 16 | #endif // __clang__ |
| 17 | #endif // _LIBCPP_VERSION |
| 18 | #endif // __cplusplus |