push_function (cfunc);
- ccode.add_declaration ("gpointer*", new CCodeVariableDeclarator ("data", new CCodeIdentifier ("user_data")));
- ccode.add_declaration ("gpointer", new CCodeVariableDeclarator ("object", new CCodeElementAccess (new CCodeIdentifier ("data"), new CCodeConstant ("0"))));
-
bool first = true;
foreach (Method m in sym.get_methods ()) {
continue;
}
+ if (first) {
+ ccode.add_declaration ("gpointer*", new CCodeVariableDeclarator ("data", new CCodeIdentifier ("user_data")));
+ ccode.add_declaration ("gpointer", new CCodeVariableDeclarator ("object", new CCodeElementAccess (new CCodeIdentifier ("data"), new CCodeConstant ("0"))));
+ }
+
cfile.add_include ("string.h");
var ccheck = new CCodeFunctionCall (new CCodeIdentifier ("strcmp"));
push_function (cfunc);
- ccode.add_declaration ("gpointer*", new CCodeVariableDeclarator ("data", new CCodeIdentifier ("user_data")));
-
- ccode.add_declaration ("gpointer", new CCodeVariableDeclarator ("object", new CCodeElementAccess (new CCodeIdentifier ("data"), new CCodeConstant ("0"))));
-
bool firstif = true;
foreach (Property prop in sym.get_properties ()) {
continue;
}
+ if (firstif) {
+ ccode.add_declaration ("gpointer*", new CCodeVariableDeclarator ("data", new CCodeIdentifier ("user_data")));
+ ccode.add_declaration ("gpointer", new CCodeVariableDeclarator ("object", new CCodeElementAccess (new CCodeIdentifier ("data"), new CCodeConstant ("0"))));
+ }
+
cfile.add_include ("string.h");
var ccheck = new CCodeFunctionCall (new CCodeIdentifier ("strcmp"));
push_function (cfunc);
- ccode.add_declaration ("gpointer*", new CCodeVariableDeclarator ("data", new CCodeIdentifier ("user_data")));
-
- ccode.add_declaration ("gpointer", new CCodeVariableDeclarator ("object", new CCodeElementAccess (new CCodeIdentifier ("data"), new CCodeConstant ("0"))));
-
bool firstif = true;
foreach (Property prop in sym.get_properties ()) {
continue;
}
+ if (firstif) {
+ ccode.add_declaration ("gpointer*", new CCodeVariableDeclarator ("data", new CCodeIdentifier ("user_data")));
+ ccode.add_declaration ("gpointer", new CCodeVariableDeclarator ("object", new CCodeElementAccess (new CCodeIdentifier ("data"), new CCodeConstant ("0"))));
+ }
+
cfile.add_include ("string.h");
var ccheck = new CCodeFunctionCall (new CCodeIdentifier ("strcmp"));