mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-26 20:22:11 +01:00
gstrfuncs: Use separate preprocessor conditionals for g-i and gtk-doc
GObject-Introspection and gtk-doc both parse C headers using regular expressions, so they can easily be confused by non-trivial conditions. GObject-Introspection warns about this: .../gstrfuncs.h:151: the __GI_SCANNER__ constant should only be used with simple #ifdef or #endif: #if !defined (__GTK_DOC_IGNORE__) && !defined (__GI_SCANNER__) In this case it's very easy to convert the compound expression into nesting. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
d5bf03cbcb
commit
30352032a6
@ -147,7 +147,8 @@ gboolean (g_str_has_prefix) (const gchar *str,
|
||||
const gchar *prefix);
|
||||
|
||||
#if G_GNUC_CHECK_VERSION (2, 0)
|
||||
#if !defined (__GTK_DOC_IGNORE__) && !defined (__GI_SCANNER__)
|
||||
#ifndef __GTK_DOC_IGNORE__
|
||||
#ifndef __GI_SCANNER__
|
||||
|
||||
/* This macro is defeat a false -Wnonnull warning in GCC.
|
||||
* Without it, it thinks strlen and memcmp may be getting passed NULL
|
||||
@ -220,7 +221,8 @@ gboolean (g_str_has_prefix) (const gchar *str,
|
||||
(g_strdup) ((STR)) \
|
||||
)
|
||||
|
||||
#endif /* !defined (__GTK_DOC_IGNORE__) && !defined (__GI_SCANNER__) */
|
||||
#endif /* !defined (__GI_SCANNER__) */
|
||||
#endif /* !defined (__GTK_DOC_IGNORE__) */
|
||||
#endif /* G_GNUC_CHECK_VERSION (2, 0) */
|
||||
|
||||
/* String to/from double conversion functions */
|
||||
|
Loading…
x
Reference in New Issue
Block a user