glib/gvarianttypeinfo: use G_ENABLE_DEBUG not !G_DISABLE_ASSERT

Distributions are directed to disable G_ENABLE_DEBUG in stable builds.
Many do not currently disable assertion checks with G_DISABLE_ASSERT.

However this code is very much meant for debugging implementation details
rather than runtime validation. Use G_ENABLE_DEBUG instead of
!G_DISABLE_ASSERT to get the intended behavior.
This commit is contained in:
Christian Hergert 2024-09-23 15:46:54 -07:00
parent 84b6f747cb
commit 9eb9df2396

View File

@ -161,7 +161,7 @@ static void
g_variant_type_info_check (const GVariantTypeInfo *info,
char container_class)
{
#ifndef G_DISABLE_ASSERT
#ifdef G_ENABLE_DEBUG
g_assert (!container_class || info->container_class == container_class);
/* alignment can only be one of these */
@ -190,7 +190,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_DISABLE_ASSERT */
#endif /* G_ENABLE_DEBUG */
}
/* < private >