util: move static_assert polyfill to test-util.h
It's no longer used in the main source code.
This commit is contained in:
parent
74e6f02ee4
commit
dd65a0c06b
@ -25,10 +25,4 @@ typedef intptr_t ssize_t;
|
|||||||
#define inline __inline
|
#define inline __inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Polyfill `static_assert` for some versions of clang and gcc. */
|
|
||||||
#if (defined(__clang__) || defined(__GNUC__)) && !defined(static_assert)
|
|
||||||
#define static_assert(condition, message) typedef __attribute__( \
|
|
||||||
(__unused__)) int __static_assert_##__LINE__[(condition) ? 1 : -1]
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* WEPOLL_UTIL_H_ */
|
#endif /* WEPOLL_UTIL_H_ */
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#ifndef TEST_UTIL_H_
|
#ifndef TEST_UTIL_H_
|
||||||
#define TEST_UTIL_H_
|
#define TEST_UTIL_H_
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic ignored "-Wbad-function-cast"
|
#pragma clang diagnostic ignored "-Wbad-function-cast"
|
||||||
#pragma clang diagnostic ignored "-Wcast-qual"
|
#pragma clang diagnostic ignored "-Wcast-qual"
|
||||||
@ -33,4 +35,10 @@ void no_inline no_return check_fail(const char* message);
|
|||||||
" line: " _check_to_string(__LINE__) "\n"), \
|
" line: " _check_to_string(__LINE__) "\n"), \
|
||||||
0))
|
0))
|
||||||
|
|
||||||
|
/* Polyfill `static_assert` for some versions of clang and gcc. */
|
||||||
|
#if (defined(__clang__) || defined(__GNUC__)) && !defined(static_assert)
|
||||||
|
#define static_assert(condition, message) typedef __attribute__( \
|
||||||
|
(__unused__)) int __static_assert_##__LINE__[(condition) ? 1 : -1]
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* TEST_UTIL_H_ */
|
#endif /* TEST_UTIL_H_ */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user