rpicamsrc: sync autotools with glib-mkenum usage in meson build

This commit is contained in:
Tim-Philipp Müller 2020-05-02 19:27:20 +00:00
parent 1c25fe131d
commit e5593a4c9c
2 changed files with 20 additions and 22 deletions

View file

@ -4,36 +4,36 @@
/*** END file-header ***/ /*** END file-header ***/
/*** BEGIN file-production ***/ /*** BEGIN file-production ***/
/* enumerations from "@filename@" */ /* enumerations from "@basename@" */
#include "@filename@" #include "@filename@"
#define C_ENUM(v) ((gint) v)
#define C_FLAGS(v) ((guint) v)
/*** END file-production ***/ /*** END file-production ***/
/*** BEGIN value-header ***/ /*** BEGIN value-header ***/
GType GType
@enum_name@_get_type (void) @enum_name@_get_type (void)
{ {
static GType the_type = 0; static volatile gsize gtype_id = 0;
if (the_type == 0) if (g_once_init_enter (&gtype_id)) {
{
static const G@Type@Value values[] = { static const G@Type@Value values[] = {
/*** END value-header ***/ /*** END value-header ***/
/*** BEGIN value-production ***/ /*** BEGIN value-production ***/
{ @VALUENAME@, { C_@TYPE@(@VALUENAME@), "@VALUENAME@", "@valuenick@" },
"@VALUENAME@",
"@valuenick@" },
/*** END value-production ***/ /*** END value-production ***/
/*** BEGIN value-tail ***/ /*** BEGIN value-tail ***/
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
the_type = g_@type@_register_static (
g_intern_static_string ("@EnumName@"), GType new_type = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
values); g_once_init_leave (&gtype_id, new_type);
} }
return the_type; return (GType) gtype_id;
} }
/*** END value-tail ***/ /*** END value-tail ***/

View file

@ -1,6 +1,5 @@
/*** BEGIN file-header ***/ /*** BEGIN file-header ***/
#ifndef __GSTRPICAM_ENUM_TYPES_H__ #pragma once
#define __GSTRPICAM_ENUM_TYPES_H__
#include <glib-object.h> #include <glib-object.h>
@ -9,18 +8,17 @@ G_BEGIN_DECLS
/*** END file-header ***/ /*** END file-header ***/
/*** BEGIN file-production ***/ /*** BEGIN file-production ***/
/* Enumerations from "@filename@" */ /* Enumerations from "@basename@" */
/*** END file-production ***/ /*** END file-production ***/
/*** BEGIN enumeration-production ***/ /*** BEGIN enumeration-production ***/
#define GST_RPI_CAM_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
GType @enum_name@_get_type (void) G_GNUC_CONST; GType @enum_name@_get_type (void);
/*** END enumeration-production ***/ /*** END enumeration-production ***/
/*** BEGIN file-tail ***/ /*** BEGIN file-tail ***/
G_END_DECLS G_END_DECLS
#endif /* __GSTRPICAM_ENUM_TYPES_H__ */
/*** END file-tail ***/ /*** END file-tail ***/