summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Borelli <pborelli@gnome.org>2015-11-03 11:45:26 +0100
committerIgnacio Casal Quinteiro <icq@gnome.org>2015-11-04 19:54:06 +0100
commit35acf971258358bea5c5d8647fe0ef756d473b99 (patch)
tree9acc66293682f777d26a787b9a3f4469d5d44f7d
parentb61dcb1303b1f5a6d6608f263353a0cfc64ed214 (diff)
downloadlibsoup-35acf971258358bea5c5d8647fe0ef756d473b99.tar.gz
Makefile.glib: support marking get_type as extern
Add GLIB_MKENUMS_EXTERN to the template, so that a program can redefine it to ensure the function is exported in MSVC builds https://bugzilla.gnome.org/show_bug.cgi?id=757146
-rw-r--r--Makefile.glib3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile.glib b/Makefile.glib
index 9e063536..97e94b0b 100644
--- a/Makefile.glib
+++ b/Makefile.glib
@@ -206,7 +206,8 @@ $(1).h.stamp: $(_glib_enum_types_h_sources) Makefile
$$(GLIB_MKENUMS_H_FLAGS) \
$$($(_glib_enum_types_prefix)_MKENUMS_H_FLAGS) \
--fhead "#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
- --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n" \
+ --fhead "#ifndef GLIB_MKENUMS_EXTERN\n#define GLIB_MKENUMS_EXTERN\n#endif\n" \
+ --vhead "GLIB_MKENUMS_EXTERN GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n" \
--ftail "G_END_DECLS\n\n#endif /* $(_glib_enum_types_guard) */" \
$$(filter-out Makefile, $$^) > $(1).h.tmp && \
(cmp -s $(1).h.tmp $(1).h || cp $(1).h.tmp $(1).h) && \