[glib] glib-genmarshal: wrap prototypes in G_{BEGIN,END}_DECLS.



commit 31ae2c559810675aae483269f234a349cd933528
Author: Mihai Moldovan <ionic ionic de>
Date:   Sat Jul 29 09:09:39 2017 +0200

    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 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in
index 907957b..ed6de0a 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
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]