mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
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
This commit is contained in:
parent
c4dc30e2a3
commit
31ae2c5598
@ -556,7 +556,7 @@ def generate_prototype(retval, params,
|
|||||||
va_marshal=False):
|
va_marshal=False):
|
||||||
'''Generate a marshaller declaration with the given @visibility. If @va_marshal
|
'''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.'''
|
is True, the marshaller will use variadic arguments in place of a GValue array.'''
|
||||||
signature = []
|
signature = ['G_BEGIN_DECLS']
|
||||||
|
|
||||||
if visibility == Visibility.INTERNAL:
|
if visibility == Visibility.INTERNAL:
|
||||||
signature += ['G_GNUC_INTERNAL']
|
signature += ['G_GNUC_INTERNAL']
|
||||||
@ -585,6 +585,8 @@ def generate_prototype(retval, params,
|
|||||||
signature += [indent('int n_params,', level=width, fill=' ')]
|
signature += [indent('int n_params,', level=width, fill=' ')]
|
||||||
signature += [indent('GType *param_types);', level=width, fill=' ')]
|
signature += [indent('GType *param_types);', level=width, fill=' ')]
|
||||||
|
|
||||||
|
signature += ['G_END_DECLS']
|
||||||
|
|
||||||
return signature
|
return signature
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user