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:
Simon McVittie 2023-02-10 13:14:42 +00:00
parent d5bf03cbcb
commit 30352032a6

View File

@ -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 */