Skip to content

Commit

Permalink
Separate logic
Browse files Browse the repository at this point in the history
  • Loading branch information
torben-hansen committed Nov 26, 2024
1 parent fc36824 commit f97e667
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion third_party/jitterentropy/src/jitterentropy-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ extern "C" {
/* Portable switch fall-through to silence warnings. Only works for C. */
#if defined(__GNUC__) && __GNUC__ >= 7 // gcc 7
#define JE_FALLTHROUGH __attribute__ ((fallthrough))
#elif defined(__clang__) && __has_attribute(fallthrough) && __clang_major__ >= 5
#elif defined(__clang__)
/* Separate logic to avoid errors when compiler doesn't understand __has_attribute */
#if __has_attribute(fallthrough) && __clang_major__ >= 5
/*
* Clang 3.5, at least, complains about "error: declaration does not declare
* anything", possibly because we put a semicolon after this macro in
Expand All @@ -61,6 +63,9 @@ extern "C" {
#else
#define JE_FALLTHROUGH
#endif
#else
#define JE_FALLTHROUGH
#endif

#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

Expand Down

0 comments on commit f97e667

Please sign in to comment.