Skip to content

Commit

Permalink
refactor(util): remove platform-specific M_FALLTHROUGH_INTENDED defines
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftb0y committed Jun 29, 2022
1 parent e5f5adb commit 27e2309
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/util/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,4 @@
#error We do not support your compiler. Please email [email protected] and tell us about your use case.
#endif

#if defined(__clang__) && defined(__has_warning)
#if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
#define M_FALLTHROUGH_INTENDED [[clang::fallthrough]]
#endif
#elif defined(__GNUC__) && __GNUC__ >= 7
// Taken from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough_003d
// We could also use a comment, but that would require ccache users to set the
// keep_comments_cpp option. If we switch to C++17, we can use [[fallthough]].
#define M_FALLTHROUGH_INTENDED __attribute__ ((fallthrough));
#endif

#ifndef M_FALLTHROUGH_INTENDED
#define M_FALLTHROUGH_INTENDED \
do { \
} while (0)
#endif
#define M_FALLTHROUGH_INTENDED [[fallthrough]]

0 comments on commit 27e2309

Please sign in to comment.