From: Tim-Philipp Müller Date: Sat, 2 May 2020 19:27:20 +0000 (+0000) Subject: rpicamsrc: sync autotools with glib-mkenum usage in meson build X-Git-Tag: 1.19.3~509^2~493^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5593a4c9c35a56749d68d5974b868968ac29e98;p=platform%2Fupstream%2Fgstreamer.git rpicamsrc: sync autotools with glib-mkenum usage in meson build --- diff --git a/sys/rpicamsrc/gstrpicam-enums-template.c b/sys/rpicamsrc/gstrpicam-enums-template.c index b9dee13..8631751 100644 --- a/sys/rpicamsrc/gstrpicam-enums-template.c +++ b/sys/rpicamsrc/gstrpicam-enums-template.c @@ -4,36 +4,36 @@ /*** END file-header ***/ /*** BEGIN file-production ***/ -/* enumerations from "@filename@" */ +/* enumerations from "@basename@" */ #include "@filename@" +#define C_ENUM(v) ((gint) v) +#define C_FLAGS(v) ((guint) v) + /*** END file-production ***/ /*** BEGIN value-header ***/ GType @enum_name@_get_type (void) { - static GType the_type = 0; - - if (the_type == 0) - { - static const G@Type@Value values[] = { + static volatile gsize gtype_id = 0; + + if (g_once_init_enter (>ype_id)) { + static const G@Type@Value values[] = { /*** END value-header ***/ /*** BEGIN value-production ***/ - { @VALUENAME@, - "@VALUENAME@", - "@valuenick@" }, + { C_@TYPE@(@VALUENAME@), "@VALUENAME@", "@valuenick@" }, /*** END value-production ***/ /*** BEGIN value-tail ***/ - { 0, NULL, NULL } - }; - the_type = g_@type@_register_static ( - g_intern_static_string ("@EnumName@"), - values); - } - return the_type; + { 0, NULL, NULL } + }; + + GType new_type = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); + g_once_init_leave (>ype_id, new_type); + } + return (GType) gtype_id; } /*** END value-tail ***/ diff --git a/sys/rpicamsrc/gstrpicam-enums-template.h b/sys/rpicamsrc/gstrpicam-enums-template.h index 62b49ca..eb25042 100644 --- a/sys/rpicamsrc/gstrpicam-enums-template.h +++ b/sys/rpicamsrc/gstrpicam-enums-template.h @@ -1,6 +1,5 @@ /*** BEGIN file-header ***/ -#ifndef __GSTRPICAM_ENUM_TYPES_H__ -#define __GSTRPICAM_ENUM_TYPES_H__ +#pragma once #include @@ -9,18 +8,17 @@ G_BEGIN_DECLS /*** END file-header ***/ /*** BEGIN file-production ***/ -/* Enumerations from "@filename@" */ +/* Enumerations from "@basename@" */ /*** END file-production ***/ /*** BEGIN enumeration-production ***/ -#define GST_RPI_CAM_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) -GType @enum_name@_get_type (void) G_GNUC_CONST; +#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) +GType @enum_name@_get_type (void); /*** END enumeration-production ***/ /*** BEGIN file-tail ***/ G_END_DECLS -#endif /* __GSTRPICAM_ENUM_TYPES_H__ */ /*** END file-tail ***/