mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 06:56:14 +01:00
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 5ecd3cbe52
and allows the gobject/enums test to pass on CheriBSD (Morello).
Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
This commit is contained in:
parent
35fe0d0bba
commit
dfa0d60db2
@ -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; \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user