return m.get_attribute_double ("CCode", "generic_type_pos");
}
+ public static bool get_ccode_no_wrapper (Method m) {
+ return m.get_attribute ("NoWrapper") != null;
+ }
+
public static string get_ccode_sentinel (Method m) {
return get_ccode_attribute(m).sentinel;
}
}
if (m.base_method != null) {
- if (m.base_method.get_attribute ("NoWrapper") != null) {
+ if (get_ccode_no_wrapper (m.base_method)) {
var base_class = (Class) m.base_method.parent_symbol;
if (!base_class.is_compact) {
CCodeFunctionCall vclass;
set_cvalue (expr, new CCodeIdentifier (get_ccode_name (m.base_method)));
}
} else if (m.base_interface_method != null) {
- if (m.base_interface_method.get_attribute ("NoWrapper") != null) {
+ if (get_ccode_no_wrapper (m.base_interface_method)) {
var base_iface = (Interface) m.base_interface_method.parent_symbol;
CCodeFunctionCall vclass;
if (base_iface.external_package) {
async_call.call = new CCodeMemberAccess.pointer (vcast, get_ccode_vfunc_name (m));
finish_call.call = new CCodeMemberAccess.pointer (vcast, get_ccode_finish_vfunc_name (m));
}
- } else if (m != null && m.get_attribute ("NoWrapper") != null && m.binding == MemberBinding.INSTANCE && !(m is CreationMethod)) {
+ } else if (m != null && get_ccode_no_wrapper (m) && m.binding == MemberBinding.INSTANCE && !(m is CreationMethod)) {
var instance_value = ma.inner.target_value;
if ((ma.member_name == "begin" || ma.member_name == "end") && ma.inner.symbol_reference == ma.symbol_reference) {
var inner_ma = (MemberAccess) ma.inner;
if (m.is_async_callback) {
return false;
}
- if ((m.is_abstract || m.is_virtual) && m.get_attribute ("NoWrapper") != null) {
+ if ((m.is_abstract || m.is_virtual) && get_ccode_no_wrapper (m)) {
return false;
}
if (add_symbol_declaration (decl_space, m, get_ccode_name (m))) {
pop_context ();
if ((m.is_abstract || m.is_virtual) && !m.coroutine
- && m.get_attribute ("NoWrapper") == null
+ && !get_ccode_no_wrapper (m)
// If the method is a signal handler, the declaration is not needed.
// the name should be reserved for the emitter!
&& m.signal_reference == null) {
public override bool generate_method_declaration (Method m, CCodeFile decl_space) {
if (m.coroutine) {
- if ((m.is_abstract || m.is_virtual) && m.get_attribute ("NoWrapper") != null) {
+ if ((m.is_abstract || m.is_virtual) && get_ccode_no_wrapper (m)) {
return false;
}
if (add_symbol_declaration (decl_space, m, get_ccode_name (m))) {
}
}
- if ((m.is_abstract || m.is_virtual) && m.get_attribute ("NoWrapper") == null) {
+ if ((m.is_abstract || m.is_virtual) && !get_ccode_no_wrapper (m)) {
// generate virtual function wrappers
var cparam_map = new HashMap<int,CCodeParameter> (direct_hash, direct_equal);
var carg_map = new HashMap<int,CCodeExpression> (direct_hash, direct_equal);
tag_name = "function";
}
- if (m.get_attribute ("NoWrapper") == null) {
+ if (!get_ccode_no_wrapper (m)) {
write_signature (m, tag_name, true);
}
write_indent ();
buffer.append_printf ("<%s name=\"%s\"", tag_name, name);
if (tag_name == "virtual-method") {
- if (m.get_attribute ("NoWrapper") == null) {
+ if (!get_ccode_no_wrapper (m)) {
buffer.append_printf (" invoker=\"%s\"", name);
}
} else if (tag_name == "callback") {