+2007-07-11 Jürg Billeter <j@bitron.ch>
+
+ * ccode/valaccodefragment.vala, ccode/valaccodenode.vala,
+ ccode/valaccodeoncesection.vala, gobject/valacodegenerator.vala,
+ gobject/valacodegeneratorsourcefile.vala: fix order in C header file
+ * tests/test-014.vala, tests/test-014.out: test public delegate
+
+ Fixes bug 442703
+
2007-07-11 Jürg Billeter <j@bitron.ch>
* vala/valaforeachstatement.vala: call visit_end_full_expression for
node.write_declaration (writer);
}
}
+
+ public override void write_combined (CCodeWriter! writer) {
+ foreach (CCodeNode node in children) {
+ node.write_combined (writer);
+ }
+ }
}
*/
public virtual void write_declaration (CCodeWriter! writer) {
}
+
+ /**
+ * Writes declaration and implementation combined for this code node and
+ * all children with the specified C code writer.
+ *
+ * @param writer a C code writer
+ */
+ public virtual void write_combined (CCodeWriter! writer) {
+ write_declaration (writer);
+ write (writer);
+ }
}
writer.write_string (define);
writer.write_newline ();
foreach (CCodeNode node in get_children ()) {
- node.write_declaration (writer);
- }
- foreach (CCodeNode node in get_children ()) {
- node.write (writer);
+ node.write_combined (writer);
}
writer.write_indent ();
writer.write_string ("#endif");
var ctypedef = new CCodeTypeDefinition (cb.return_type.get_cname (), cfundecl);
if (cb.access != MemberAccessibility.PRIVATE) {
- header_type_declaration.append (ctypedef);
+ header_type_definition.append (ctypedef);
} else {
source_type_member_declaration.append (ctypedef);
}
once.append (new CCodeIdentifier ("G_END_DECLS"));
once.append (new CCodeNewline ());
once.append (new CCodeNewline ());
- once.write_declaration (writer);
once.write (writer);
writer.close ();
-Callback Test: 1 2 3
+Delegate Test: 1 2 3
using GLib;
-static delegate int Maman.ActionCallback ();
+public static delegate int Maman.ActionCallback ();
class Maman.Bar {
static int do_action () {
}
static int main (string[] args) {
- stdout.printf ("Callback Test: 1");
+ stdout.printf ("Delegate Test: 1");
ActionCallback cb = do_action;