diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-04-15 19:58:34 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-04-15 19:58:34 +0200 |
commit | c09069c88949532f5cb35a9d2c692db2b669d414 (patch) | |
tree | 1a31158d864d65af9958d2fd906740cbf29e6a11 | |
parent | 484c3272c46d78ad4920ac54b3197b9f1eb3eeb0 (diff) |
Use g_once_init_*() instead of GOnce for the enum types
-rw-r--r-- | gst/Makefile.am | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/Makefile.am b/gst/Makefile.am index 83e7fc80e8..d67ea805d6 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -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 |