summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2013-07-04 18:44:34 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2013-07-05 10:27:16 +0200
commit8e520d0788fbd3b16900b354fdf403dd1ddea7eb (patch)
treef31578f14d891d355acc7b8357825b3c9020a903
parenta63c691b2f1d1dd4d212b27fea0534f2481ebcc8 (diff)
downloadlibrest-8e520d0788fbd3b16900b354fdf403dd1ddea7eb.tar.gz
Add marshaller for RestProxy::authenticate signal
g_cclosure_marshal_generic() was only introduced in glib 2.30, for older glib we need to specify the marshaller to use. If only NULL is passed, we get a segfault when trying to invoke the signal. https://bugzilla.gnome.org/show_bug.cgi?id=703642
-rw-r--r--rest/Makefile.am18
-rw-r--r--rest/rest-marshal.txt1
-rw-r--r--rest/rest-proxy.c4
3 files changed, 21 insertions, 2 deletions
diff --git a/rest/Makefile.am b/rest/Makefile.am
index f33fcf7..da2a56b 100644
--- a/rest/Makefile.am
+++ b/rest/Makefile.am
@@ -25,6 +25,9 @@ lib_sources = \
oauth2-proxy-private.h \
sha1.c \
sha1.h
+nodist_lib_sources = \
+ rest-marshal.h \
+ rest-marshal.c
lib_headers = \
rest-param.h \
rest-params.h \
@@ -39,6 +42,9 @@ lib_headers = \
rest-xml-node.h \
rest-xml-parser.h
+EXTRA_DIST = \
+ rest-marshal.txt
+
lib_LTLIBRARIES = librest-@API_VERSION@.la
librest_@API_VERSION@_la_CFLAGS = $(GLIB_CFLAGS) $(GTHREAD_CFLAGS) \
$(SOUP_CFLAGS) $(SOUP_GNOME_CFLAGS) \
@@ -49,6 +55,7 @@ librest_@API_VERSION@_la_LIBADD = $(GLIB_LIBS) $(GTHREAD_LIBS) \
$(SOUP_LIBS) $(SOUP_GNOME_LIBS) $(XML_LIBS) \
$(GCOV_LDFLAGS)
librest_@API_VERSION@_la_SOURCES = $(lib_sources) $(lib_headers)
+nodist_librest_@API_VERSION@_la_SOURCES = $(nodist_lib_sources)
librest_@API_VERSION@_la_HEADERS = $(lib_headers)
librest_@API_VERSION@_ladir = $(includedir)/rest-@API_VERSION@/rest
@@ -76,12 +83,21 @@ rest-enum-types.c: rest-proxy.h rest-proxy-call.h Makefile rest-enum-types.h
&& cp xgen-gtbc rest-enum-types.c \
&& rm -f xgen-gtbc
+BUILT_SOURCES = rest-marshal.c rest-marshal.h
+
+rest-marshal.c: rest-marshal.txt
+ $(AM_V_GEN)echo "#include \"rest-marshal.h\"" > $@ && \
+ glib-genmarshal --body $< >> $@ || (rm -f $@ && exit 1)
+
+rest-marshal.h: rest-marshal.txt
+ $(AM_V_GEN)glib-genmarshal --header $< > $@ || (rm -f $@ && exit 1)
+
# Test suite
TESTS = test-runner
check_PROGRAMS = test-runner
-test_runner_SOURCES = test-runner.c $(lib_sources) $(lib_headers)
+test_runner_SOURCES = test-runner.c $(lib_sources) $(nodist_lib_sources) $(lib_headers)
test_runner_CFLAGS = -DBUILD_TESTS $(librest_@API_VERSION@_la_CFLAGS) $(GCOV_CFLAGS)
test_runner_LDFLAGS = $(librest_@API_VERSION@_la_LIBADD) $(GCOV_LDFLAGS)
diff --git a/rest/rest-marshal.txt b/rest/rest-marshal.txt
new file mode 100644
index 0000000..98fb74b
--- /dev/null
+++ b/rest/rest-marshal.txt
@@ -0,0 +1 @@
+BOOLEAN:OBJECT,BOOLEAN
diff --git a/rest/rest-proxy.c b/rest/rest-proxy.c
index caff4c8..a9b91dd 100644
--- a/rest/rest-proxy.c
+++ b/rest/rest-proxy.c
@@ -28,6 +28,7 @@
#include <libsoup/soup-gnome.h>
#endif
+#include "rest-marshal.h"
#include "rest-proxy-auth-private.h"
#include "rest-proxy.h"
#include "rest-private.h"
@@ -375,7 +376,8 @@ rest_proxy_class_init (RestProxyClass *klass)
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (RestProxyClass, authenticate),
- g_signal_accumulator_true_handled, NULL, NULL,
+ g_signal_accumulator_true_handled, NULL,
+ g_cclosure_user_marshal_BOOLEAN__OBJECT_BOOLEAN,
G_TYPE_BOOLEAN, 2,
REST_TYPE_PROXY_AUTH,
G_TYPE_BOOLEAN);