var indirection_sig = mproperty.build_csignature(mclass_type, mmodule, "___cpp_impl_mid", long_signature, internal_call_context)
## In C file (__ffi.c)
-
+
# Declare the indirection function in C
ecc.body_decl.add("{indirection_sig};\n")
# FFI concers common between the compilers and the interpreter.
# Offers services to compile modules using foreign code. Mainly allows
# to wrap foreign code in Nit methods.
-module common_ffi
+module ffi
import modelbuilder
# does the super module has inherited dependancies?
var hd = m.header_dependencies
- if not hd.is_empty then
+ if not hd.is_empty then
header_dependencies.add_all(hd)
end
# Returns the list of C functions to link with extern Java methods, as required
# to enable this callback from Java code.
- #
+ #
# Return used by `MModule::ensure_linking_callback_methods`
#
# TODO we return an Array to support cast and other features like that
private fun jni_type: String do return "jint"
# JNI short type name (for signatures)
- #
+ #
# Is used by `MMethod::build_jni_format` to pass a Java method signature
# to the JNI function `GetStaticMetodId`.
private fun jni_format: String do return "I"
redef class MMethod
# Returns the JNI signature format of this Nit method
- #
+ #
# Example: a Nity signature `(Bool, Int, Float, JavaString)` is represented by
# the JNI format `(ZIDLjava/lang/string;)V"
private fun build_jni_format(recv_mtype: MClassType, from_mmodule: MModule): String