summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@gnome.org>2024-10-01 12:24:30 +0100
committerPhilip Withnall <pwithnall@gnome.org>2024-10-01 12:24:30 +0100
commitc920d2257bce8c492af7d1fa75a6c7fef377a308 (patch)
treee39247e06712c8e2dc388bd2e04df73c68183401
parente4f5c2e9c5537d8db09334b2d8551b57ca5577f3 (diff)
gvariant: Fix unused variables when G_DISABLE_ASSERT is defined
This fixes commit 9eb9df2396, which I really should have noticed at the time would cause a load of unused variables to be declared if compiled with `G_DISABLE_ASSERT`. That’s what the original `#ifdef`s were to protect against. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
-rw-r--r--glib/gvarianttypeinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/glib/gvarianttypeinfo.c b/glib/gvarianttypeinfo.c
index c1705d887..ca4e96de6 100644
--- a/glib/gvarianttypeinfo.c
+++ b/glib/gvarianttypeinfo.c
@@ -162,7 +162,7 @@ static void
g_variant_type_info_check (const GVariantTypeInfo *info,
char container_class)
{
-#ifdef G_ENABLE_DEBUG
+#if defined(G_ENABLE_DEBUG) && !defined(G_DISABLE_ASSERT)
g_assert (!container_class || info->container_class == container_class);
/* alignment can only be one of these */
@@ -191,7 +191,7 @@ g_variant_type_info_check (const GVariantTypeInfo *info,
g_assert (0 <= index && index < 24);
g_assert (g_variant_type_info_basic_chars[index][0] != ' ');
}
-#endif /* G_ENABLE_DEBUG */
+#endif /* G_ENABLE_DEBUG && !G_DISABLE_ASSERT */
}
/* < private >