From: Alexis Laferrière Date: Mon, 18 Apr 2016 17:23:01 +0000 (-0400) Subject: interpreter: the annotation light_ffi identifies a method as light FFI only X-Git-Url: http://nitlanguage.org interpreter: the annotation light_ffi identifies a method as light FFI only Signed-off-by: Alexis Laferrière --- diff --git a/src/frontend/check_annotation.nit b/src/frontend/check_annotation.nit index 5adcabd..680fa67 100644 --- a/src/frontend/check_annotation.nit +++ b/src/frontend/check_annotation.nit @@ -100,6 +100,7 @@ auto_inspect pkgconfig cflags ldflags +light_ffi platform """ diff --git a/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit b/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit index e826f05..5593f87 100644 --- a/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit +++ b/src/interpreter/dynamic_loading_ffi/on_demand_compiler.nit @@ -37,8 +37,13 @@ redef class AMethPropdef # * Must use the nested foreign code block of the FFI. # * Must not have callbacks. # * Must be implemented in C. + # * Must not have a parameter or return typed with a Nit standard class. fun supported_by_dynamic_ffi: Bool do + # If the user specfied `is light_ffi`, it must be supported + var nats = get_annotations("light_ffi") + if nats.not_empty then return true + var n_extern_code_block = n_extern_code_block if not (n_extern_calls == null and n_extern_code_block != null and n_extern_code_block.is_c) then return false