From 31ae2c559810675aae483269f234a349cd933528 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Sat, 29 Jul 2017 09:09:39 +0200 Subject: [PATCH] glib-genmarshal: wrap prototypes in G_{BEGIN,END}_DECLS. Since --header --body has been deprecated and replaced with --body --prototypes, the generated body is not wrapped with G_{BEGIN,END}_DECLS any longer. Projects using C++ break due to that. Automatically wrap prototypes individually in G_{BEGIN,END}_DECLS instead. https://bugzilla.gnome.org/show_bug.cgi?id=785554 --- gobject/glib-genmarshal.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in index 907957b4c..ed6de0ae8 100755 --- a/gobject/glib-genmarshal.in +++ b/gobject/glib-genmarshal.in @@ -556,7 +556,7 @@ def generate_prototype(retval, params, va_marshal=False): '''Generate a marshaller declaration with the given @visibility. If @va_marshal is True, the marshaller will use variadic arguments in place of a GValue array.''' - signature = [] + signature = ['G_BEGIN_DECLS'] if visibility == Visibility.INTERNAL: signature += ['G_GNUC_INTERNAL'] @@ -585,6 +585,8 @@ def generate_prototype(retval, params, signature += [indent('int n_params,', level=width, fill=' ')] signature += [indent('GType *param_types);', level=width, fill=' ')] + signature += ['G_END_DECLS'] + return signature