ccode.close ();
- var carrfree = new CCodeFunctionCall (new CCodeIdentifier ("g_free"));
+ CCodeFunctionCall carrfree;
+ if (context.profile == Profile.POSIX) {
+ carrfree = new CCodeFunctionCall (new CCodeIdentifier ("free"));
+ } else {
+ carrfree = new CCodeFunctionCall (new CCodeIdentifier ("g_free"));
+ }
carrfree.add_argument (new CCodeIdentifier ("array"));
ccode.add_expression (carrfree);
ccall.add_argument (new CCodeIdentifier ("destroy_func"));
ccode.add_expression (ccall);
- var carrfree = new CCodeFunctionCall (new CCodeIdentifier ("g_free"));
+ CCodeFunctionCall carrfree;
+ if (context.profile == Profile.POSIX) {
+ carrfree = new CCodeFunctionCall (new CCodeIdentifier ("free"));
+ } else {
+ carrfree = new CCodeFunctionCall (new CCodeIdentifier ("g_free"));
+ }
carrfree.add_argument (new CCodeIdentifier ("array"));
ccode.add_expression (carrfree);
ccode.add_expression (destroy_call);
}
- var free_call = new CCodeFunctionCall (new CCodeIdentifier ("g_free"));
+ CCodeFunctionCall free_call;
+ if (context.profile == Profile.POSIX) {
+ free_call = new CCodeFunctionCall (new CCodeIdentifier ("free"));
+ } else {
+ free_call = new CCodeFunctionCall (new CCodeIdentifier ("g_free"));
+ }
free_call.add_argument (new CCodeIdentifier ("self"));
ccode.add_expression (free_call);
if (type.type_symbol is Struct && ((Struct) type.type_symbol).is_disposable ()) {
unref_function = generate_free_func_wrapper (type);
} else {
- unref_function = "g_free";
+ if (context.profile == Profile.POSIX) {
+ unref_function = "free";
+ } else {
+ unref_function = "g_free";
+ }
}
}
} else if (type is EnumValueType) {