Index: gobject/gobjectmodule.c
===================================================================
--- gobject/gobjectmodule.c	(revision 636)
+++ gobject/gobjectmodule.c	(arbetskopia)
@@ -27,6 +27,7 @@
 #include "pygobject-private.h"
 #include "pythread.h"
 #include <gobject/gvaluecollector.h>
+#include <cinvoke.h>
 
 static PyObject *gerror_exc = NULL;
 static gboolean use_gil_state_api = FALSE;
@@ -462,6 +463,148 @@
     class->get_property = pyg_object_get_property;
 }
 
+static void 
+g_value_to_cinvoke (const GValue *gvalue, char *format, void **value)
+{
+  GType type = g_type_fundamental (G_VALUE_TYPE (gvalue));
+
+  switch (type) {
+  case G_TYPE_BOOLEAN:
+  case G_TYPE_CHAR:
+  case G_TYPE_INT:
+    *format = 'i';
+    *value = (void*)&(gvalue->data[0].v_int);
+    break;
+  case G_TYPE_UCHAR:
+  case G_TYPE_UINT:
+    *format = 'i';
+    *value = (void*)&(gvalue->data[0].v_uint);
+    break;
+  case G_TYPE_OBJECT:
+  case G_TYPE_STRING:
+  case G_TYPE_POINTER:
+    *format = 'p';
+    *value = (void*)&(gvalue->data[0].v_pointer);
+    break;
+  case G_TYPE_FLOAT:
+    *format = 'f';
+    *value = (void*)&(gvalue->data[0].v_float);
+    break;
+  case G_TYPE_DOUBLE:
+    *format = 'd';
+    *value = (void*)&(gvalue->data[0].v_double);
+    break;
+  case G_TYPE_LONG:
+    *format = 'l';
+    *value = (void*)&(gvalue->data[0].v_long);
+    break;
+  case G_TYPE_ULONG:
+    *format = 'l';
+    *value = (void*)&(gvalue->data[0].v_ulong);
+    break;
+  case G_TYPE_INT64:
+    *format = '8';
+    *value = (void*)&(gvalue->data[0].v_int64);
+    break;
+  case G_TYPE_UINT64:
+    *format = '8';
+    *value = (void*)&(gvalue->data[0].v_uint64);
+    break;
+  default:
+    g_warning ("Unsupported fundamental type: %s\n", g_type_name (type));
+    break;
+  }
+}
+
+static void
+g_cclosure_marshal_generic (GClosure *closure,
+			    GValue *return_gvalue,
+			    guint n_param_values,
+			    const GValue *param_values,
+			    gpointer invocation_hint,
+			    gpointer marshal_data)
+
+{
+  static CInvContext *ctx = NULL;
+  CInvFunction *function;
+  int i;
+  char *return_format;
+  void *return_value;
+  char *parameter_format;
+  void **parameter_values;
+  GCClosure *cc = (GCClosure*) closure;
+
+  if (!ctx)
+    {
+      ctx = cinv_context_create ();
+      if (!ctx) 
+	g_error ("cinv_function_create failed: %s\n",
+		 cinv_context_geterrormsg (ctx));
+    }
+
+  if (return_gvalue) 
+    {
+      return_format = g_new0 (char, 2);
+      g_value_to_cinvoke (return_gvalue, return_format, &return_value);
+    }
+  else 
+    {
+      return_format = "";
+      return_value = NULL;
+    }
+  
+  parameter_format = g_new (char, n_param_values + 2);
+  parameter_values = g_new (void *, n_param_values + 1);
+
+  if (G_CCLOSURE_SWAP_DATA (closure))
+    {
+      g_value_to_cinvoke (param_values + 0, 
+			  &parameter_format[n_param_values], 
+			  &parameter_values[n_param_values]);
+      parameter_format[0] = 'p';
+      parameter_values[0] = &closure->data;
+    }
+  else
+    {
+      g_value_to_cinvoke (param_values + 0, 
+			  &parameter_format[0], 
+			  &parameter_values[0]);
+      parameter_format[n_param_values] = 'p';
+      parameter_values[n_param_values] = &closure->data;
+    }
+
+  for (i = 1; i < n_param_values; i++)
+    {
+      g_value_to_cinvoke (param_values + i,
+			  &parameter_format[i],
+			  &parameter_values[i]);
+    }
+  parameter_format[n_param_values+1] = '\0';
+
+  function = cinv_function_create (ctx, CINV_CC_DEFAULT, 
+				   return_format, parameter_format);
+  
+  if (cinv_function_invoke (ctx, function, 
+			    marshal_data ? marshal_data : cc->callback,
+			    return_value,
+			    parameter_values) != CINV_SUCCESS) 
+    {
+      g_error ("cinv_function_invoke failed: %s\n",
+	       cinv_context_geterrormsg (ctx));
+    }
+			   
+  g_free (parameter_format);
+  g_free (parameter_values);
+  if (return_gvalue)
+    g_free (return_format);
+
+  if (cinv_function_delete (ctx, function) != CINV_SUCCESS) 
+    {
+      g_error ("freeing cinvoke function failed: %s\n",
+	       cinv_context_geterrormsg (ctx));
+    }
+}
+
 typedef struct _PyGSignalAccumulatorData {
     PyObject *callable;
     PyObject *user_data;
@@ -593,7 +736,7 @@
     signal_id = g_signal_newv(signal_name, instance_type, signal_flags,
 			      pyg_signal_class_closure_get(),
 			      accumulator, accum_data,
-			      (GSignalCMarshaller)0,
+			      g_cclosure_marshal_generic,
 			      return_type, n_params, param_types);
     g_free(param_types);
 
Index: gobject/Makefile.am
===================================================================
--- gobject/Makefile.am	(revision 636)
+++ gobject/Makefile.am	(arbetskopia)
@@ -21,7 +21,7 @@
 
 _gobject_la_CFLAGS = $(GLIB_CFLAGS)
 _gobject_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gobject
-_gobject_la_LIBADD = $(GLIB_LIBS)
+_gobject_la_LIBADD = $(GLIB_LIBS) -lcinvoke
 _gobject_la_SOURCES = \
 	gobjectmodule.c \
 	pygboxed.c \
