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

Alexandre Julliard julliard at winehq.org
Sat Feb 16 09:57:34 CST 2008


Module: wine
Branch: master
Commit: f59570db68f20dfe9155dad0cc677d11ab5600e7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f59570db68f20dfe9155dad0cc677d11ab5600e7

Author: Rob Shearman <rob at codeweavers.com>
Date:   Fri Feb 15 15:44:19 2008 +0000

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.

---

 include/winnt.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/winnt.h b/include/winnt.h
index 7ac4703..4489e93 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -282,7 +282,9 @@ 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]
+# define C_ASSERT(e) extern char __C_ASSERT__[(e)?1:-1] __attribute__((unused))
+#else
+# define C_ASSERT(e)
 #endif
 
 /* Eliminate Microsoft C/C++ compiler warning 4715 */




More information about the wine-cvs mailing list