# Unbox extern classes to be used in extern code (legacy NI and FFI)
fun unbox_extern(value: RuntimeVariable, mtype: MType): RuntimeVariable is abstract
src/compiler/abstract_compiler.nit:1495,2--1496,84
redef fun unbox_extern(value, mtype)
do
if mtype isa MClassType and mtype.mclass.kind == extern_kind and
mtype.mclass.name != "CString" then
var pointer_type = compiler.mainmodule.pointer_type
var res = self.new_var_extern(mtype)
self.add "{res} = ((struct instance_{pointer_type.c_name}*){value})->value; /* unboxing {value.mtype} */"
return res
else
return value
end
end
src/compiler/separate_compiler.nit:1352,2--1363,4
redef fun unbox_extern(value, mtype)
do
if mtype isa MClassType and mtype.mclass.kind == extern_kind and
mtype.mclass.name != "CString" then
var res = self.new_var_extern(mtype)
self.add "{res} = ((struct {mtype.c_name}*){value})->value; /* unboxing {value.mtype} */"
return res
else
return value
end
end
src/compiler/global_compiler.nit:367,2--377,4
redef fun unbox_extern(value, mtype)
do
if mtype isa MClassType and mtype.mclass.kind == extern_kind and
mtype.mclass.name != "CString" then
var pointer_type = compiler.mainmodule.pointer_type
var res = self.new_var_extern(mtype)
self.add "{res} = ((struct instance_{pointer_type.c_name}*){value})->value; /* unboxing {value.mtype} */"
return res
else
return value
end
end
src/compiler/separate_erasure_compiler.nit:664,2--675,4