public string module_init_param_name;
public bool gvaluecollector_h_needed;
+ public bool requires_assert;
public bool requires_array_free;
public bool requires_array_move;
public bool requires_array_length;
next_regex_id = 0;
gvaluecollector_h_needed = false;
+ requires_assert = false;
requires_array_free = false;
requires_array_move = false;
requires_array_length = false;
return;
}
+ if (requires_assert) {
+ cfile.add_type_declaration (new CCodeMacroReplacement.with_expression ("_vala_assert(expr, msg)", new CCodeConstant ("if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);")));
+ }
if (requires_array_free) {
append_vala_array_free ();
}
ccode.add_label ("_state_%d".printf (state));
}
+ if (expr.is_assert) {
+ string message = ((string) expr.source_reference.begin.pos).substring (0, (int) (expr.source_reference.end.pos - expr.source_reference.begin.pos));
+ ccall.call = new CCodeIdentifier ("_vala_assert");
+ ccall.add_argument (new CCodeConstant ("\"%s\"".printf (message.replace ("\n", " ").escape (""))));
+ requires_assert = true;
+
+ }
+
if (return_result_via_out_param) {
ccode.add_expression (ccall_expr);
ccall_expr = out_param_ref;
if (ma.symbol_reference != null && ma.symbol_reference.get_attribute ("Assert") != null) {
this.is_assert = true;
+
+ var args = get_argument_list ();
+ if (args.size == 1) {
+ this.source_reference = args[0].source_reference;
+ }
}
}