Index: vala/valamethod.vala =================================================================== --- vala/valamethod.vala (revision 409) +++ vala/valamethod.vala (working copy) @@ -126,6 +126,24 @@ } } } + + /** + * Returns the name of the vfunc of this method as it is used in C code. + * + * @return the vfunc's name to be used in C code + */ + public string! vfunc_name { + get { + if (_vfunc_name == null) { + _vfunc_name = this.name; + } + return _vfunc_name; + } + set { + _vfunc_name = value; + } + } + /** * Specifies whether this method expects printf-style format arguments. @@ -135,6 +153,7 @@ private bool _instance = true; private Gee.List parameters = new ArrayList (); private string cname; + private string _vfunc_name; private bool _no_array_length; private Gee.List error_domains = new ArrayList (); @@ -247,6 +266,7 @@ public void set_cname (string cname) { this.cname = cname; } + private void process_ccode_attribute (Attribute a) { if (a.has_argument ("cname")) { @@ -258,6 +278,9 @@ add_cheader_filename (filename); } } + if (a.has_argument ("vfunc_name")) { + this.vfunc_name = a.get_string ("vfunc_name"); + } } /** Index: gobject/valacodegeneratorclass.vala =================================================================== --- gobject/valacodegeneratorclass.vala (revision 409) +++ gobject/valacodegeneratorclass.vala (working copy) @@ -216,7 +216,7 @@ var ccast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (((Class) base_type).get_upper_case_cname (null)))); ccast.add_argument (new CCodeIdentifier ("klass")); - init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ccast, m.name), new CCodeIdentifier (m.get_real_cname ())))); + init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ccast, m.vfunc_name), new CCodeIdentifier (m.get_real_cname ())))); } /* create dup_func and destroy_func properties for generic types */ @@ -323,7 +323,7 @@ } var ciface = new CCodeIdentifier ("iface"); - init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, m.name), new CCodeIdentifier (m.get_real_cname ())))); + init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (ciface, m.vfunc_name), new CCodeIdentifier (m.get_real_cname ())))); } source_type_member_definition.append (iface_init); Index: gobject/valacodegeneratormethod.vala =================================================================== --- gobject/valacodegeneratormethod.vala (revision 409) +++ gobject/valacodegeneratormethod.vala (working copy) @@ -119,7 +119,7 @@ if (m.is_abstract || m.is_virtual) { var vdecl = new CCodeDeclaration (m.return_type.get_cname ()); - vdeclarator = new CCodeFunctionDeclarator (m.name); + vdeclarator = new CCodeFunctionDeclarator (m.vfunc_name); vdecl.add_declarator (vdeclarator); type_struct.add_declaration (vdecl); @@ -332,7 +332,7 @@ } vcast.add_argument (new CCodeIdentifier ("self")); - var vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, m.name)); + var vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, m.vfunc_name)); vcall.add_argument (new CCodeIdentifier ("self")); var params = m.get_parameters ();