http://bugs.winehq.org/show_bug.cgi?id=25945
--- Comment #2 from Alexander Scott-Johns alexander.scott.johns+winebug@googlemail.com 2011-02-02 10:34:34 CST --- According to the GCC documentation, GCC 2.95 supports array designators and (rvalue) array literals. And according to the c1x draft, <assert.h> should define a static_assert macro. So this should work:
#if defined(static_assert) # define C_ASSERT(e) static_assert((e), #e " should be true") #elif defined(_MSC_VER) # define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] #else # define C_ASSERT(e) \ extern void __C_ASSERT__(int [sizeof((char[]){ [-!(e)] = 0 })]) #endif