Commit 6faf9066 authored by Thomas Guillem's avatar Thomas Guillem Committed by Rémi Denis-Courmont

compat: fix static_assert

It was not possible to use it outside of functions.
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 4e668bca
......@@ -273,7 +273,9 @@ static inline locale_t newlocale(int mask, const char * locale, locale_t base)
#endif
#if !defined (HAVE_STATIC_ASSERT) && !defined(__cpp_static_assert)
# define _Static_assert(x, s) ((void) sizeof (struct { unsigned:-!(x); }))
# define STATIC_ASSERT_CONCAT_(a, b) a##b
# define STATIC_ASSERT_CONCAT(a, b) STATIC_ASSERT_CONCAT_(a, b)
# define _Static_assert(x, s) extern char STATIC_ASSERT_CONCAT(static_assert_, __LINE__)[sizeof(struct { unsigned:-!(x); })]
# define static_assert _Static_assert
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment