mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
Use g_once_init_*() instead of GOnce for the enum types
This commit is contained in:
parent
484c3272c4
commit
c09069c889
1 changed files with 2 additions and 2 deletions
|
@ -227,9 +227,9 @@ gstenumtypes.c: $(gst_headers)
|
|||
glib-mkenums \
|
||||
--fhead "#include \"gst_private.h\"\n#include <gst/gst.h>\n#define C_ENUM(v) ((gint) v)\n#define C_FLAGS(v) ((guint) v)\n " \
|
||||
--fprod "\n/* enumerations from \"@filename@\" */" \
|
||||
--vhead "static void\nregister_@enum_name@ (GType* id)\n{\n static const G@Type@Value values[] = {" \
|
||||
--vhead "GType\n@enum_name@_get_type (void)\n{\n static gsize id = 0;\n static const G@Type@Value values[] = {" \
|
||||
--vprod " { C_@TYPE@(@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" }," \
|
||||
--vtail " { 0, NULL, NULL }\n };\n *id = g_@type@_register_static (\"@EnumName@\", values);\n}\nGType\n@enum_name@_get_type (void)\n{\n static GType id;\n static GOnce once = G_ONCE_INIT;\n\n g_once (&once, (GThreadFunc)register_@enum_name@, &id);\n return id;\n}\n" \
|
||||
--vtail " { 0, NULL, NULL }\n };\n\n if (g_once_init_enter (&id)) {\n GType tmp = g_@type@_register_static (\"@EnumName@\", values);\n g_once_init_leave (&id, tmp);\n }\n\n return (GType) id;\n}" \
|
||||
$^ > gstenumtypes.c
|
||||
|
||||
%.c.gcov: .libs/libgstreamer_@GST_MAJORMINOR@_la-%.gcda %.c
|
||||
|
|
Loading…
Reference in a new issue