+2008-04-06 Jürg Billeter <j@bitron.ch>
+
+ * gobject/valaccodegenerator.vala,
+ gobject/valaccodegeneratorclass.vala,
+ gobject/valaccodegeneratorinterface.vala,
+ gobject/valaccodegeneratorsourcefile.vala,
+ gobject/valaccodegeneratorstruct.vala:
+
+ Add source_type_declaration and source_type_definition code
+ fragments to fix declaration order in generated C source files
+
2008-03-31 Jürg Billeter <j@bitron.ch>
* vala/Makefile.am, vala/parser.y, vala/vala.h,
CCodeFragment header_constant_declaration;
CCodeFragment source_begin;
CCodeFragment source_include_directives;
+ CCodeFragment source_type_declaration;
+ CCodeFragment source_type_definition;
public CCodeFragment source_type_member_declaration;
CCodeFragment source_constant_declaration;
CCodeFragment source_signal_marshaller_declaration;
decl_frag = header_type_declaration;
def_frag = header_type_definition;
} else {
- decl_frag = source_type_member_declaration;
- def_frag = source_type_member_declaration;
+ decl_frag = source_type_declaration;
+ def_frag = source_type_definition;
}
def_frag.append (cenum);
if (!d.is_internal_symbol ()) {
header_type_declaration.append (ctypedef);
} else {
- source_type_member_declaration.append (ctypedef);
+ source_type_declaration.append (ctypedef);
}
}
decl_frag = header_type_declaration;
def_frag = header_type_definition;
} else {
- decl_frag = source_type_member_declaration;
- def_frag = source_type_member_declaration;
+ decl_frag = source_type_declaration;
+ def_frag = source_type_definition;
}
if (is_gtypeinstance) {
decl_frag = header_type_declaration;
def_frag = header_type_definition;
} else {
- decl_frag = source_type_member_declaration;
- def_frag = source_type_member_declaration;
+ decl_frag = source_type_declaration;
+ def_frag = source_type_definition;
}
if (!iface.is_static && !iface.declaration_only) {
header_constant_declaration = new CCodeFragment ();
source_begin = new CCodeFragment ();
source_include_directives = new CCodeFragment ();
+ source_type_declaration = new CCodeFragment ();
+ source_type_definition = new CCodeFragment ();
source_type_member_declaration = new CCodeFragment ();
source_constant_declaration = new CCodeFragment ();
source_type_member_definition = new CCodeFragment ();
writer.write_newline ();
source_include_directives.write (writer);
writer.write_newline ();
+ source_type_declaration.write_combined (writer);
+ writer.write_newline ();
+ source_type_definition.write_combined (writer);
+ writer.write_newline ();
source_type_member_declaration.write_declaration (writer);
writer.write_newline ();
source_type_member_declaration.write (writer);
header_constant_declaration = null;
source_begin = null;
source_include_directives = null;
+ source_type_declaration = null;
+ source_type_definition = null;
source_type_member_declaration = null;
source_constant_declaration = null;
source_type_member_definition = null;
decl_frag = header_type_declaration;
def_frag = header_type_definition;
} else {
- decl_frag = source_type_member_declaration;
- def_frag = source_type_member_declaration;
+ decl_frag = source_type_declaration;
+ def_frag = source_type_definition;
}
if (st.source_reference.file.cycle == null) {