Merge branch 'wip/chergert/gvariant-use-proper-macros-conditions' into 'main'

Fix incorrect use of assert/debug/check macros

See merge request GNOME/glib!4292
This commit is contained in:
Philip Withnall
2024-09-25 15:06:10 +00:00
2 changed files with 3 additions and 3 deletions

View File

@ -278,7 +278,7 @@ typedef struct _GVariantType GVariantType;
* *
* Since 2.24 * Since 2.24
**/ **/
#ifndef G_DISABLE_CHECKS #ifndef G_DISABLE_CAST_CHECKS
# define G_VARIANT_TYPE(type_string) (g_variant_type_checked_ ((type_string))) # define G_VARIANT_TYPE(type_string) (g_variant_type_checked_ ((type_string)))
#else #else
# define G_VARIANT_TYPE(type_string) ((const GVariantType *) (type_string)) # define G_VARIANT_TYPE(type_string) ((const GVariantType *) (type_string))

View File

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