diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-23 15:30:40 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-03-01 14:54:59 +0000 |
commit | 1eee3b6d61e52c5bf23128236c9f8f931f5ea033 (patch) | |
tree | 01b12e080c90bb44605f83a1353192132bb4db04 /tools | |
parent | daed91cba508fa2cc72df986f14585725d324c51 (diff) | |
download | telepathy-glib-1eee3b6d61e52c5bf23128236c9f8f931f5ea033.tar.gz |
Generate code that uses g_cclosure_marshal_generic()
I'm using the symbol explicitly in the generated code, because if
someone copies the tools into another project but forgets to increase
the GLib dependency, failing to compile with a missing symbol is a much
nicer failure mode than failing to work at runtime. (Also, I haven't
checked whether dbus-glib copes gracefully with NULL as a marshaller.)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46523
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/glib-client-marshaller-gen.py | 3 | ||||
-rw-r--r-- | tools/glib-ginterface-gen.py | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/tools/glib-client-marshaller-gen.py b/tools/glib-client-marshaller-gen.py index 54447255b..cb27d638a 100644 --- a/tools/glib-client-marshaller-gen.py +++ b/tools/glib-client-marshaller-gen.py @@ -40,7 +40,8 @@ class Generator(object): for marshaller in all: rhs = self.marshallers[marshaller] - print ' dbus_g_object_register_marshaller (%s,' % marshaller + print ' dbus_g_object_register_marshaller (' + print ' g_cclosure_marshal_generic,' print ' G_TYPE_NONE, /* return */' for type in rhs: print ' G_TYPE_%s,' % type.replace('VOID', 'NONE') diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py index e277b91f4..cc4e1f0c4 100644 --- a/tools/glib-ginterface-gen.py +++ b/tools/glib-ginterface-gen.py @@ -27,8 +27,7 @@ import os.path import xml.dom.minidom from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ - NS_TP, dbus_gutils_wincaps_to_uscore, \ - signal_to_marshal_name, method_to_glue_marshal_name + NS_TP, dbus_gutils_wincaps_to_uscore NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" @@ -421,8 +420,7 @@ class Generator(object): 'not match' % (method.getAttribute('name'), lc_name)) lc_name = lc_name.lower() - marshaller = method_to_glue_marshal_name(method, - self.signal_marshal_prefix) + marshaller = 'g_cclosure_marshal_generic' wrapper = self.prefix_ + self.node_name_lc + '_' + lc_name self.b(" { (GCallback) %s, %s, %d }," % (wrapper, marshaller, offset)) @@ -717,8 +715,7 @@ class Generator(object): in_base_init.append(' G_SIGNAL_RUN_LAST|G_SIGNAL_DETAILED,') in_base_init.append(' 0,') in_base_init.append(' NULL, NULL,') - in_base_init.append(' %s,' - % signal_to_marshal_name(signal, self.signal_marshal_prefix)) + in_base_init.append(' g_cclosure_marshal_generic,') in_base_init.append(' G_TYPE_NONE,') tmp = ['%d' % len(args)] + [gtype for (ctype, name, gtype) in args] in_base_init.append(' %s);' % ',\n '.join(tmp)) |