diff options
author | Milan Crha <mcrha@redhat.com> | 2013-04-12 15:52:56 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-04-12 15:52:56 +0800 |
commit | 8c251448dc43cba28f29517d4920322cc91c8e06 (patch) | |
tree | 081c6b089dae190e6d147f9aecea745ff82c58a3 /e-util | |
parent | ed1b2fb86fea5a1d2c03b06b5305556f2ed6d731 (diff) | |
download | gsoc2013-evolution-8c251448dc43cba28f29517d4920322cc91c8e06.tar gsoc2013-evolution-8c251448dc43cba28f29517d4920322cc91c8e06.tar.gz gsoc2013-evolution-8c251448dc43cba28f29517d4920322cc91c8e06.tar.bz2 gsoc2013-evolution-8c251448dc43cba28f29517d4920322cc91c8e06.tar.lz gsoc2013-evolution-8c251448dc43cba28f29517d4920322cc91c8e06.tar.xz gsoc2013-evolution-8c251448dc43cba28f29517d4920322cc91c8e06.tar.zst gsoc2013-evolution-8c251448dc43cba28f29517d4920322cc91c8e06.zip |
Bug #681837 - Make enum type registration thread safe
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/Makefile.am | 15 | ||||
-rw-r--r-- | e-util/e-util-enumtypes.c.template | 38 | ||||
-rw-r--r-- | e-util/e-util-enumtypes.h.template | 27 |
3 files changed, 9 insertions, 71 deletions
diff --git a/e-util/Makefile.am b/e-util/Makefile.am index 9fa1877396..b9710a5207 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -6,11 +6,16 @@ ruledir = $(privdatadir) ENUM_TYPES = e-util-enums.h -e-util-enumtypes.h: e-util-enumtypes.h.template $(ENUM_TYPES) - $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template e-util-enumtypes.h.template $(ENUM_TYPES)) > $@ +e-util-enumtypes.h: $(top_srcdir)/enumtypes.h.template $(ENUM_TYPES) + $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template $(top_srcdir)/enumtypes.h.template \ + --fhead "#ifndef E_UTIL_ENUMTYPES_H\n#define E_UTIL_ENUMTYPES_H\n" \ + --ftail "#endif /* E_UTIL_ENUMTYPES_H */\n" \ + $(ENUM_TYPES)) > $@ -e-util-enumtypes.c: e-util-enumtypes.c.template $(ENUM_TYPES) - $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template e-util-enumtypes.c.template $(ENUM_TYPES)) > $@ +e-util-enumtypes.c: $(top_srcdir)/enumtypes.c.template $(ENUM_TYPES) + $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template $(top_srcdir)/enumtypes.c.template \ + --fhead "#include \"e-util-enumtypes.h\"" \ + $(ENUM_TYPES)) > $@ e-marshal.h: e-marshal.list $(AM_V_GEN) $(GLIB_GENMARSHAL) --header --prefix=e_marshal $^ > e-marshal.h.tmp && \ @@ -650,8 +655,6 @@ test_source_selector_SOURCES = test-source-selector.c test_source_selector_LDADD = $(TEST_LDADD) EXTRA_DIST = \ - e-util-enumtypes.h.template \ - e-util-enumtypes.c.template \ e-system.error.xml \ filter.error.xml \ widgets.error.xml \ diff --git a/e-util/e-util-enumtypes.c.template b/e-util/e-util-enumtypes.c.template deleted file mode 100644 index cb2634790c..0000000000 --- a/e-util/e-util-enumtypes.c.template +++ /dev/null @@ -1,38 +0,0 @@ -/*** BEGIN file-header ***/ -#include "e-util-enumtypes.h" - -/*** END file-header ***/ - -/*** BEGIN file-production ***/ -/* enumerations from "@filename@" */ -#include "@filename@" - -/*** 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[] = { -/*** END value-header ***/ - -/*** BEGIN value-production ***/ - { @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; -} - -/*** END value-tail ***/ diff --git a/e-util/e-util-enumtypes.h.template b/e-util/e-util-enumtypes.h.template deleted file mode 100644 index c5bfa9c2c1..0000000000 --- a/e-util/e-util-enumtypes.h.template +++ /dev/null @@ -1,27 +0,0 @@ -/*** BEGIN file-header ***/ -#ifndef E_UTIL_ENUMTYPES_H -#define E_UTIL_ENUMTYPES_H - -#include <glib-object.h> - -G_BEGIN_DECLS - -/*** END file-header ***/ - -/*** BEGIN file-production ***/ -/* Enumerations from "@filename@" */ - -/*** END file-production ***/ - -/*** BEGIN enumeration-production ***/ -#define E_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) -GType @enum_name@_get_type (void) G_GNUC_CONST; - -/*** END enumeration-production ***/ - -/*** BEGIN file-tail ***/ -G_END_DECLS - -#endif /* E_UTIL_ENUMTYPES_H */ -/*** END file-tail ***/ - |