diff --git a/src/util.h b/src/util.h index 803de5d..41cb35d 100644 --- a/src/util.h +++ b/src/util.h @@ -25,10 +25,4 @@ typedef intptr_t ssize_t; #define inline __inline #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_ */ diff --git a/test/shared/test-util.h b/test/shared/test-util.h index 68c9497..458e83b 100644 --- a/test/shared/test-util.h +++ b/test/shared/test-util.h @@ -1,6 +1,8 @@ #ifndef TEST_UTIL_H_ #define TEST_UTIL_H_ +#include + #ifdef __clang__ #pragma clang diagnostic ignored "-Wbad-function-cast" #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"), \ 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_ */