]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove STATIC_ASSERT variants in favor of the C11 variant
authorOndřej Surý <ondrej@isc.org>
Fri, 28 Feb 2025 20:51:18 +0000 (21:51 +0100)
committerOndřej Surý <ondrej@isc.org>
Sat, 1 Mar 2025 06:33:53 +0000 (07:33 +0100)
Previously, a gcc < 4.6 shim for _Static_assert() was included.  Such an
old compiler is not supported now anyway, so the macro variant has been
removed in favor of a single definition using _Static_assert().

lib/isc/include/isc/util.h

index 805e518afce17be50ff2c4012bb7a0475bc34f24..9fed22df60c71b4157018b40ab9ad32b799f1312 100644 (file)
 #define ISC_NO_SANITIZE_THREAD
 #endif /* if __SANITIZE_THREAD__ */
 
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR >= 6)
 #define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
-#elif __has_feature(c_static_assert)
-#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
-#else /* if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR >= 6) */
-
-/* Courtesy of Joseph Quinsey: https://godbolt.org/z/K9RvWS */
-#define TOKENPASTE(a, b)       a##b /* "##" is the "Token Pasting Operator" */
-#define EXPAND_THEN_PASTE(a, b) TOKENPASTE(a, b) /* expand then paste */
-#define STATIC_ASSERT(x, msg) \
-       enum { EXPAND_THEN_PASTE(ASSERT_line_, __LINE__) = 1 / ((msg) && (x)) }
-#endif /* if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR >= 6) */
 
 #ifdef UNIT_TESTING
 extern void