}
}
+ // Add function prototypes for required register-type-calls which are likely external
+ var register_func = new CCodeFunction ("%s_register_type".printf (get_ccode_lower_case_name (type_symbol, null)), "GType");
+ register_func.add_parameter (new CCodeParameter ("module", "GTypeModule *"));
+ register_func.is_declaration = true;
+ cfile.add_function_declaration (register_func);
+
var register_call = new CCodeFunctionCall (new CCodeIdentifier ("%s_register_type".printf (get_ccode_lower_case_name (type_symbol, null))));
register_call.add_argument (new CCodeIdentifier (module_init_param_name));
ccode.add_expression (register_call);
// avoid C warning as this function is not always used
fun.modifiers |= CCodeModifiers.INTERNAL | CCodeModifiers.UNUSED;
}
+
+ fun.is_declaration = true;
+ declaration_fragment.append (fun.copy ());
+ fun.is_declaration = false;
} else {
fun = new CCodeFunction ("%s_register_type".printf (CCodeBaseModule.get_ccode_lower_case_name (get_type_declaration ())), "GType");
fun.add_parameter (new CCodeParameter ("module", "GTypeModule *"));
type_block.add_statement (new CCodeReturnStatement (new CCodeIdentifier (type_id_name)));
}
- fun.is_declaration = true;
- declaration_fragment.append (fun.copy ());
- fun.is_declaration = false;
-
fun.block = type_block;
definition_fragment.append (fun);