]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Define STATIC_ASSERT(cond, msg) to be _Static_assert(cond, msg) everywhere but on...
authorOndřej Surý <ondrej@sury.org>
Tue, 13 Nov 2018 20:43:11 +0000 (21:43 +0100)
committerMark Andrews <marka@isc.org>
Wed, 14 Nov 2018 23:18:27 +0000 (18:18 -0500)
lib/isc/include/isc/util.h

index 97eb51a193f1fce132770f5f1824db6ad9c93c92..ecd9e8c52ac8c96d362af246b130a0a4148d158e 100644 (file)
 #define ISC_UNREACHABLE()
 #endif
 
+#if !defined(__has_feature)
+#define __has_feature(x) 0
+#endif
+
+#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
+#define STATIC_ASSERT(cond, msg) INSIST(cond)
+#endif
+
 #ifdef UNIT_TESTING
 extern void mock_assert(const int result, const char* const expression,
                        const char * const file, const int line);