mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Add a fallthrough macro.
This macro defers to __attribute__((fallthrough)) on GCC (and clang). Previously we had been using GCC's magic /* fallthrough */ comments, but clang very sensibly doesn't accept those. Since not all compiler recognize it, we only define it when our configure script detects that it works. Part of a fix for 34078.
This commit is contained in:
@@ -50,6 +50,12 @@
|
||||
#define CHECK_SCANF(formatIdx, firstArg)
|
||||
#endif /* defined(__GNUC__) */
|
||||
|
||||
#if defined(HAVE_ATTR_FALLTHROUGH)
|
||||
#define FALLTHROUGH __attribute__((fallthrough))
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
|
||||
/* What GCC do we have? */
|
||||
#ifdef __GNUC__
|
||||
#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
|
||||
|
||||
Reference in New Issue
Block a user