diff options
author | Milan Crha <mcrha@redhat.com> | 2013-04-12 15:50:06 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-04-12 15:50:06 +0800 |
commit | 1c5f6313c58187ce7682058057b63e14ae6f70e5 (patch) | |
tree | b32502d72fe77f9e42e47b89df5e9034b92b9546 /libemail-engine | |
parent | 765a50d3df2d53b73b149fc2646f46722add7635 (diff) | |
download | gsoc2013-evolution-1c5f6313c58187ce7682058057b63e14ae6f70e5.tar gsoc2013-evolution-1c5f6313c58187ce7682058057b63e14ae6f70e5.tar.gz gsoc2013-evolution-1c5f6313c58187ce7682058057b63e14ae6f70e5.tar.bz2 gsoc2013-evolution-1c5f6313c58187ce7682058057b63e14ae6f70e5.tar.lz gsoc2013-evolution-1c5f6313c58187ce7682058057b63e14ae6f70e5.tar.xz gsoc2013-evolution-1c5f6313c58187ce7682058057b63e14ae6f70e5.tar.zst gsoc2013-evolution-1c5f6313c58187ce7682058057b63e14ae6f70e5.zip |
Bug #681837 - Make enum type registration thread safe
Diffstat (limited to 'libemail-engine')
-rw-r--r-- | libemail-engine/Makefile.am | 18 | ||||
-rw-r--r-- | libemail-engine/e-mail-enumtypes.c.template | 38 | ||||
-rw-r--r-- | libemail-engine/e-mail-enumtypes.h.template | 27 |
3 files changed, 9 insertions, 74 deletions
diff --git a/libemail-engine/Makefile.am b/libemail-engine/Makefile.am index 60a8437c6e..d8f8207323 100644 --- a/libemail-engine/Makefile.am +++ b/libemail-engine/Makefile.am @@ -4,11 +4,16 @@ privsolib_LTLIBRARIES = libemail-engine.la ENUM_TYPES = e-mail-enums.h -e-mail-enumtypes.h: e-mail-enumtypes.h.template $(ENUM_TYPES) - $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template e-mail-enumtypes.h.template $(ENUM_TYPES)) > $@ +e-mail-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_MAIL_ENUMTYPES_H\n#define E_MAIL_ENUMTYPES_H\n" \ + --ftail "#endif /* E_MAIL_ENUMTYPES_H */\n" \ + $(ENUM_TYPES)) > $@ -e-mail-enumtypes.c: e-mail-enumtypes.c.template $(ENUM_TYPES) - $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template e-mail-enumtypes.c.template $(ENUM_TYPES)) > $@ +e-mail-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-mail-enumtypes.h\"" \ + $(ENUM_TYPES)) > $@ ENUM_GENERATED = e-mail-enumtypes.h e-mail-enumtypes.c @@ -86,11 +91,6 @@ BUILT_SOURCES = $(ENUM_GENERATED) CLEANFILES = $(BUILT_SOURCES) DISTCLEANFILES = $(pkgconfig_DATA) -EXTRA_DIST = \ - e-mail-enumtypes.h.template \ - e-mail-enumtypes.c.template \ - $(NULL) - dist-hook: cd $(distdir); rm -f $(BUILT_SOURCES) diff --git a/libemail-engine/e-mail-enumtypes.c.template b/libemail-engine/e-mail-enumtypes.c.template deleted file mode 100644 index db4f2a4503..0000000000 --- a/libemail-engine/e-mail-enumtypes.c.template +++ /dev/null @@ -1,38 +0,0 @@ -/*** BEGIN file-header ***/ -#include "e-mail-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/libemail-engine/e-mail-enumtypes.h.template b/libemail-engine/e-mail-enumtypes.h.template deleted file mode 100644 index d983a72d5c..0000000000 --- a/libemail-engine/e-mail-enumtypes.h.template +++ /dev/null @@ -1,27 +0,0 @@ -/*** BEGIN file-header ***/ -#ifndef E_MAIL_ENUMTYPES_H -#define E_MAIL_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_MAIL_ENUMTYPES_H */ -/*** END file-tail ***/ - |