mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-02 09:22:16 +01:00
Add G_STATIC_ASSERT_EXPR macro
https://bugzilla.gnome.org/show_bug.cgi?id=626549
This commit is contained in:
committed by
Matthias Clasen
parent
64d5a0404a
commit
c00ef0a17a
@@ -147,6 +147,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(expr) ((void) sizeof (char[(expr) ? 1 : -1]))
|
||||
|
||||
/* Provide a string identifying the current code position */
|
||||
#if defined(__GNUC__) && (__GNUC__ < 3) && !defined(__cplusplus)
|
||||
|
||||
Reference in New Issue
Block a user