summaryrefslogtreecommitdiff
path: root/girepository/gicallableinfo.c
diff options
context:
space:
mode:
authorGarrett Regier <garrett.regier@riftio.com>2015-06-03 05:24:21 -0700
committerGarrett Regier <garrett.regier@riftio.com>2015-06-21 13:01:25 -0700
commit0aef39a20bd229170871edda862ade7d24ff7edd (patch)
tree417e9faa0edc487d577b5c3e04d6feaa369c8766 /girepository/gicallableinfo.c
parent5d47bb3a72e12150d7862d602d5032cf920c3543 (diff)
downloadgobject-introspection-0aef39a20bd229170871edda862ade7d24ff7edd.tar.gz
girepository: Support GError exceptions on callbacks
Generalize "throws" attribute to SignatureBlob which can be used by all callable blob types. Keep FunctionBlob and VFuncBlob throw attributes around and functional for compatibility. Refactor girwriter.c to write out throws attribute for all callable types. Based on a patch by Simon Feltman. https://bugzilla.gnome.org/show_bug.cgi?id=729543
Diffstat (limited to 'girepository/gicallableinfo.c')
-rw-r--r--girepository/gicallableinfo.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/girepository/gicallableinfo.c b/girepository/gicallableinfo.c
index 7e0ec776..8360bbf4 100644
--- a/girepository/gicallableinfo.c
+++ b/girepository/gicallableinfo.c
@@ -96,6 +96,17 @@ gboolean
g_callable_info_can_throw_gerror (GICallableInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo*)info;
+ SignatureBlob *signature;
+
+ signature = (SignatureBlob *)&rinfo->typelib->data[signature_offset (info)];
+ if (signature->throws)
+ return TRUE;
+
+ /* Functions and VFuncs store "throws" in their own blobs.
+ * This info was additionally added to the SignatureBlob
+ * to support the other callables. For Functions and VFuncs,
+ * also check their legacy flag for compatibility.
+ */
switch (rinfo->type) {
case GI_INFO_TYPE_FUNCTION:
{