From 55ee075cb4066f284d6dbe0677be877ca6ee3f1f Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Sat, 7 Feb 2015 22:44:16 +0700 Subject: [PATCH] sep_compiler: add RuntimeFunction::c_fun_ptr Signed-off-by: Jean Privat --- src/compiler/separate_compiler.nit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 1.7.9.5