mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
gmacros: Define G_STATIC_ASSERT for GI Scanner
Using G_STATIC_ASSERT in headers which are introspected currently requires guarding them behind `#ifndef __GI_SCANNER__` which is really annoying. We can just define the macros to be noops in a way that the scanner doesn't trip over them. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
This commit is contained in:
parent
88da3a718d
commit
363f5ebafc
@ -878,7 +878,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif /* G_CXX_STD_CHECK_VERSION (11) */
|
#endif /* G_CXX_STD_CHECK_VERSION (11) */
|
||||||
#define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1]))
|
#define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1]))
|
||||||
#endif /* !__GI_SCANNER__ */
|
#else /* __GI_SCANNER__ */
|
||||||
|
#define G_STATIC_ASSERT(expr) static int G_PASTE (_GStaticAssertGiScannerNoop, __LINE__) G_GNUC_UNUSED
|
||||||
|
#define G_STATIC_ASSERT_EXPR(expr) static int G_PASTE (_GStaticAssertGiScannerNoop, __LINE__) G_GNUC_UNUSED
|
||||||
|
#endif /* __GI_SCANNER__ */
|
||||||
|
|
||||||
/* Provide a string identifying the current code position */
|
/* Provide a string identifying the current code position */
|
||||||
#if defined (__GNUC__) && (__GNUC__ < 3) && !defined (G_CXX_STD_VERSION)
|
#if defined (__GNUC__) && (__GNUC__ < 3) && !defined (G_CXX_STD_VERSION)
|
||||||
|
Loading…
Reference in New Issue
Block a user