include: Fix the C_ASSERT macro to not generate an unused variable warning when compiling with gcc.

Provide a fallback case for other compilers to avoid C_ASSERT being 
undefined and causing an error.
This commit is contained in:
Rob Shearman 2008-02-15 15:44:19 +00:00 committed by Alexandre Julliard
parent 8608e895eb
commit f59570db68
1 changed files with 3 additions and 1 deletions

View File

@ -282,7 +282,9 @@ extern "C" {
#if defined(_MSC_VER) #if defined(_MSC_VER)
# define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] # define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]
#elif defined(__GNUC__) #elif defined(__GNUC__)
# define C_ASSERT(e) extern char __C_ASSERT__[(e)?1:-1] # define C_ASSERT(e) extern char __C_ASSERT__[(e)?1:-1] __attribute__((unused))
#else
# define C_ASSERT(e)
#endif #endif
/* Eliminate Microsoft C/C++ compiler warning 4715 */ /* Eliminate Microsoft C/C++ compiler warning 4715 */