Gerald Pfeifer gerald@pfeifer.com writes:
The current implementation doesn't work with GCC 4.5 (or ISO C) and I failed to find any other way. :-(
Your point on this being autogenerated clearly is strong one -- either we need to change that generation or find a different way to implement C_ASSERT.
Any idea how to best approach this?
I don't have gcc 4.5 to test this, but you could try using a function instead, something like this:
diff --git a/include/winnt.h b/include/winnt.h index abcc502..aaa4112 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -292,7 +292,7 @@ extern "C" { #if defined(_MSC_VER) # define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] #elif defined(__GNUC__) -# define C_ASSERT(e) extern char __C_ASSERT__[(e)?1:-1] __attribute__((unused)) +# define C_ASSERT(e) extern void __C_ASSERT__(int [(e)?1:-1]) #else # define C_ASSERT(e) #endif