sep_compiler: add RuntimeFunction::c_fun_ptr
[nit.git] / src / compiler / separate_compiler.nit
index 9c03910..66d1162 100644 (file)
@@ -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