From dfa0d60db2dfcb749437b8860da059029eba3817 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 10 Jan 2024 15:02:38 -0800 Subject: [PATCH] genums: use g_once_init_enter_pointer for GType initializers GType is either an integer or a pointer, so we have to use the _pointer version here to support architectures such as Morello. These two lines were missed in 5ecd3cbe525debf78e38955280f3eb5804080732 and allows the gobject/enums test to pass on CheriBSD (Morello). Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842 --- gobject/genums.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gobject/genums.h b/gobject/genums.h index d253b15b1..0ee8a610d 100644 --- a/gobject/genums.h +++ b/gobject/genums.h @@ -320,14 +320,14 @@ void g_flags_complete_type_info (GType g_flags_type, #define G_DEFINE_ENUM_TYPE(TypeName, type_name, ...) \ GType \ type_name ## _get_type (void) { \ - static gsize g_define_type__static = 0; \ - if (g_once_init_enter (&g_define_type__static)) { \ + static _g_type_once_init_type g_define_type__static = 0; \ + if (_g_type_once_init_enter (&g_define_type__static)) { \ static const GEnumValue enum_values[] = { \ __VA_ARGS__ , \ { 0, NULL, NULL }, \ }; \ GType g_define_type = g_enum_register_static (g_intern_static_string (#TypeName), enum_values); \ - g_once_init_leave (&g_define_type__static, g_define_type); \ + _g_type_once_init_leave (&g_define_type__static, g_define_type); \ } \ return g_define_type__static; \ } \ @@ -363,14 +363,14 @@ type_name ## _get_type (void) { \ #define G_DEFINE_FLAGS_TYPE(TypeName, type_name, ...) \ GType \ type_name ## _get_type (void) { \ - static gsize g_define_type__static = 0; \ - if (g_once_init_enter (&g_define_type__static)) { \ + static _g_type_once_init_type g_define_type__static = 0; \ + if (_g_type_once_init_enter (&g_define_type__static)) { \ static const GFlagsValue flags_values[] = { \ __VA_ARGS__ , \ { 0, NULL, NULL }, \ }; \ GType g_define_type = g_flags_register_static (g_intern_static_string (#TypeName), flags_values); \ - g_once_init_leave (&g_define_type__static, g_define_type); \ + _g_type_once_init_leave (&g_define_type__static, g_define_type); \ } \ return g_define_type__static; \ } \