diff options
author | Iñigo Martínez <inigomartinez@gmail.com> | 2017-12-16 14:59:37 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-12-18 11:25:06 +0100 |
commit | 0735b35dd0fe87285f85c0040dfcb53cec2d1bd9 (patch) | |
tree | 91f9836bba6c365a24846869317bec15f427c0ac /libnm-glib/nm-vpn-enum-types.c.template | |
parent | a58cde8d2c9595941067be7c79e03ad34463d63a (diff) |
build: use template files for enum types' sources generation
Source files for enum types are generated by passing segments of the
source code of the files to the `glib-mkenums` command.
This patch removes those parameters where source code is used from
meson build files by moving those segmeents to template files.
https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00057.html
Diffstat (limited to 'libnm-glib/nm-vpn-enum-types.c.template')
-rw-r--r-- | libnm-glib/nm-vpn-enum-types.c.template | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libnm-glib/nm-vpn-enum-types.c.template b/libnm-glib/nm-vpn-enum-types.c.template new file mode 100644 index 0000000000..8aa02ff7e9 --- /dev/null +++ b/libnm-glib/nm-vpn-enum-types.c.template @@ -0,0 +1,37 @@ +/*** BEGIN file-header ***/ +#include "config.h" + +#include "nm-vpn-enum-types.h" + +#include "nm-vpn-plugin.h" +#include "nm-vpn-plugin-ui-interface.h" +#include "nm-vpn-plugin-utils.h" +/*** END file-header ***/ + +/*** BEGIN value-header ***/ +GType +@enum_name@_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const G@Type@Value values[] = { +/*** END value-header ***/ + +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ + +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} + +/*** END value-tail ***/ |