<sys/cdefs.h>: Fix the _Static_assert compatiblity macros.
authorSascha Wildner <saw@online.de>
Sun, 15 Sep 2013 19:32:24 +0000 (21:32 +0200)
committerSascha Wildner <saw@online.de>
Sun, 15 Sep 2013 19:32:47 +0000 (21:32 +0200)
Remove the typedef hack (which was like our CTASSERT()). Emacs was
choking on it because it is using _Static_assert like this (in verify.h):

#define _GL_VERIFY_TYPE(R, DIAGNOSTIC)  \
     struct {                           \
       _Static_assert (R, DIAGNOSTIC);  \
       int _gl_dummy;                   \
     }

GCC supports it since 4.6, so take that into account too.

sys/sys/cdefs.h

index 0cd93c2..028500d 100644 (file)
 #if (defined(__cplusplus) && __cplusplus >= 201103L) || \
     __has_extension(cxx_static_assert)
 #define        _Static_assert(x, y)    static_assert(x, y)
-#elif defined(__COUNTER__)
-#define        _Static_assert(x, y)    __Static_assert(x, __COUNTER__)
-#define        __Static_assert(x, y)   ___Static_assert(x, y)
-#define        ___Static_assert(x, y)  typedef char __assert_ ## y[(x) ? 1 : -1]
-#else
+#elif !__GNUC_PREREQ__(4, 6)
 #define        _Static_assert(x, y)    struct __hack
 #endif
 #endif