summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2023-02-10 13:49:22 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2023-02-10 13:49:22 +0000
commit9ab080c6ce70c542690a29cc7a31aaabd58b5e6d (patch)
treeaae2cb630004f06fe78ccad9416c56cbc84b3b80
parent6631e6dc1f71e4b9132a967cb0ad4b84f472f3ed (diff)
parentee223e8ec80866646f6e9d7d6dab427bbb277803 (diff)
downloadglib-9ab080c6ce70c542690a29cc7a31aaabd58b5e6d.tar.gz
Merge branch 'wip/smcv/gi-warnings' into 'main'
Avoid some warnings from GObject-Introspection See merge request GNOME/glib!3266
-rw-r--r--glib/gstrfuncs.h6
-rw-r--r--glib/gtimezone.c5
2 files changed, 6 insertions, 5 deletions
diff --git a/glib/gstrfuncs.h b/glib/gstrfuncs.h
index 569f96977..8a6830294 100644
--- a/glib/gstrfuncs.h
+++ b/glib/gstrfuncs.h
@@ -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 */
diff --git a/glib/gtimezone.c b/glib/gtimezone.c
index 20f99a621..4a4a2d010 100644
--- a/glib/gtimezone.c
+++ b/glib/gtimezone.c
@@ -445,9 +445,7 @@ zone_for_constant_offset (GTimeZone *gtz, const gchar *name)
gtz->transitions = NULL;
}
-#ifdef G_OS_UNIX
-
-#if defined(__sun) && defined(__SVR4)
+#if defined(G_OS_UNIX) && defined(__sun) && defined(__SVR4)
/*
* only used by Illumos distros or Solaris < 11: parse the /etc/default/init
* text file looking for TZ= followed by the timezone, possibly quoted
@@ -513,6 +511,7 @@ zone_identifier_illumos (void)
}
#endif /* defined(__sun) && defined(__SRVR) */
+#ifdef G_OS_UNIX
/*
* returns the path to the top of the Olson zoneinfo timezone hierarchy.
*/