diff options
author | Matthias Clasen <mclasen@redhat.com> | 2012-08-28 22:06:20 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2012-08-28 22:06:20 -0400 |
commit | 88692e4eb0a971f6d32da9207c9c91c8d8c7c8d9 (patch) | |
tree | 284b1eb2e54678898a581f31850a15d6eb52ae35 /pango/Makefile.am | |
parent | 4ea16a17ca32d11bb3fd59132823350a77568b70 (diff) | |
download | pango-88692e4eb0a971f6d32da9207c9c91c8d8c7c8d9.tar.gz |
Make enum get_type functions thread-safe
Use a more modern, template-based way of calling glib-mkenums,
and use templates that use g_once_init_enter/leave to be
thread-safe.
Diffstat (limited to 'pango/Makefile.am')
-rw-r--r-- | pango/Makefile.am | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/pango/Makefile.am b/pango/Makefile.am index 0da59c86..435b495d 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -128,29 +128,18 @@ pangoinclude_HEADERS = \ pango-enum-types.h pango-enum-types.h: s-enum-types-h -s-enum-types-h: $(pango_headers) Makefile.am +s-enum-types-h: $(pango_headers) Makefile.am pango-enum-types.h.template $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ - --fhead "#ifndef __PANGO_ENUM_TYPES_H__\n#define __PANGO_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ - --fprod "/* enumerations from \"@filename@\" */\n" \ - --vhead "GType @enum_name@_get_type (void);\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ - --ftail "G_END_DECLS\n\n#endif /* __PANGO_ENUM_TYPES_H__ */" \ - $(pango_headers) ) > tmp-pango-enum-types.h \ - && (cmp -s tmp-pango-enum-types.h pango-enum-types.h || cp tmp-pango-enum-types.h pango-enum-types.h ) \ - && $(RM) tmp-pango-enum-types.h \ - && echo timestamp > $(@F) + --template pango-enum-types.h.template \ + $(pango_headers) ) > pango-enum-types.h.tmp \ + && mv pango-enum-types.h.tmp pango-enum-types.h pango-enum-types.c: s-enum-types-c -s-enum-types-c: $(pango_headers) Makefile.am +s-enum-types-c: $(pango_headers) Makefile.am pango-enum-types.c.template $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ - --fhead "#include <pango.h>" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ - --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ - --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \ - $(pango_headers) ) > tmp-pango-enum-types.c \ - && (cmp -s tmp-pango-enum-types.c pango-enum-types.c || cp tmp-pango-enum-types.c pango-enum-types.c ) \ - && $(RM) tmp-pango-enum-types.c \ - && echo timestamp > $(@F) + --template pango-enum-types.c.template \ + $(pango_headers) ) > pango-enum-types.c.tmp \ + && mv pango-enum-types.c.tmp pango-enum-types.c pango-features.h: $(AM_V_GEN) cd $(top_builddir) && ./config.status pango/pango-features.h @@ -444,6 +433,8 @@ pango_querymodules_LDADD += libpango-$(PANGO_API_VERSION).la $(GLIB_LIBS) EXTRA_DIST = \ pango-enum-types.h \ + pango-enum-types.h.template \ + pango-enum-types.c.template \ module-defs.h \ module-defs.h.win32 \ module-defs-lang.c.win32 \ |