[glib/glib-2-30] Make G_ASSERT_STATIC work with clang
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-30] Make G_ASSERT_STATIC work with clang
- Date: Tue, 4 Oct 2011 15:57:02 +0000 (UTC)
commit 8592c2746734f629db49652bcdbc6f8a9394bbbd
Author: Ryan Lortie <desrt desrt ca>
Date: Tue Oct 4 11:52:47 2011 -0400
Make G_ASSERT_STATIC work with clang
A simplified variant of an approach proposed by Behdad.
https://bugzilla.gnome.org/show_bug.cgi?id=660413
glib/gmacros.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/glib/gmacros.h b/glib/gmacros.h
index f67fbd5..f8ce714 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -146,7 +146,7 @@
#define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
#define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
-#define G_STATIC_ASSERT(expr) typedef struct { char Compile_Time_Assertion[(expr) ? 1 : -1]; } G_PASTE (_GStaticAssert_, __LINE__)
+#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __LINE__)[(expr) ? 1 : -1]
#define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1]))
/* Provide a string identifying the current code position */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]