mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-05 00:46:16 +01:00
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
This commit is contained in:
parent
7d4dea748d
commit
e517fb6cb0
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user