From: Jürg Billeter Date: Wed, 23 Mar 2011 13:00:23 +0000 (+0100) Subject: girwriter: Skip methods with va_list parameters X-Git-Tag: 0.12.0~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b34d0803e342208f438671b733c4daee7993178;p=thirdparty%2Fvala.git girwriter: Skip methods with va_list parameters gobject-introspection does not currently support va_list parameters. --- diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala index 99b34ac7f..177676772 100644 --- a/codegen/valagirwriter.vala +++ b/codegen/valagirwriter.vala @@ -1,6 +1,6 @@ /* valagirwriter.vala * - * Copyright (C) 2008-2010 Jürg Billeter + * Copyright (C) 2008-2011 Jürg Billeter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -733,6 +733,11 @@ public class Vala.GIRWriter : CodeVisitor { return; } + // check for unsupported types + if (!check_signature (m)) { + return; + } + string tag_name = "method"; var parent = this.hierarchy.get (0); if (parent is Enum) { @@ -751,6 +756,27 @@ public class Vala.GIRWriter : CodeVisitor { } } + bool check_type (DataType type) { + // gobject-introspection does not currently support va_list parameters + if (type.get_cname () == "va_list") { + return false; + } + + return true; + } + + bool check_signature (Method m) { + if (!check_type (m.return_type)) { + return false; + } + foreach (var param in m.get_parameters ()) { + if (param.variable_type == null || !check_type (param.variable_type)) { + return false; + } + } + return true; + } + private void write_signature (Method m, string tag_name, bool instance = false) { var parent = this.hierarchy.get (0); string name;