From: Jean Privat Date: Sat, 7 Feb 2015 15:44:16 +0000 (+0700) Subject: sep_compiler: add RuntimeFunction::c_fun_ptr X-Git-Tag: v0.7.2~20^2~7 X-Git-Url: http://nitlanguage.org sep_compiler: add RuntimeFunction::c_fun_ptr Signed-off-by: Jean Privat --- diff --git a/src/compiler/separate_compiler.nit b/src/compiler/separate_compiler.nit index 9c03910..66d1162 100644 --- a/src/compiler/separate_compiler.nit +++ b/src/compiler/separate_compiler.nit @@ -1205,7 +1205,7 @@ class SeparateCompilerVisitor end self.require_declaration(const_color) - var call = "(({runtime_function.c_ret} (*){runtime_function.c_sig})({arguments.first}->class->vft[{const_color}]))({ss}) /* {mmethod} on {arguments.first.inspect}*/" + var call = "(({runtime_function.c_funptrtype})({arguments.first}->class->vft[{const_color}]))({ss}) /* {mmethod} on {arguments.first.inspect}*/" if res != null then self.add("{res} = {call};") @@ -1881,6 +1881,9 @@ class SeparateRuntimeFunction return sig.to_s end + # The C type for the function pointer. + var c_funptrtype: String is lazy do return "{c_ret}(*){c_sig}" + redef fun compile_to_c(compiler) do var mmethoddef = self.mmethoddef