Explorar el Código

Mark native methods on jvm (#9235)

RblSb hace 5 años
padre
commit
cd1045ff99
Se han modificado 2 ficheros con 2 adiciones y 1 borrados
  1. 1 0
      src/generators/genjvm.ml
  2. 1 1
      src/typing/typeloadFields.ml

+ 1 - 0
src/generators/genjvm.ml

@@ -2441,6 +2441,7 @@ class tclass_to_jvm gctx c = object(self)
 		let flags = if mtype = MStatic then MethodAccessFlags.MStatic :: flags else flags in
 		let flags = if has_class_field_flag cf CfFinal then MFinal :: flags else flags in
 		let flags = if Meta.has Meta.JvmSynthetic cf.cf_meta then MSynthetic :: flags else flags in
+		let flags = if Meta.has Meta.NativeJni cf.cf_meta then MNative :: flags else flags in
 		let name,scmode,flags = match mtype with
 			| MConstructor ->
 				let rec has_super_ctor c = match c.cl_super with

+ 1 - 1
src/typing/typeloadFields.ml

@@ -1166,7 +1166,7 @@ let create_method (ctx,cctx,fctx) c f fd p =
 			begin match ctx.com.platform with
 				| Java when is_java_native_function ctx cf.cf_meta cf.cf_pos ->
 					if fd.f_expr <> None then
-						ctx.com.warning "@:native function definitions shouldn't include an expression. This behaviour is deprecated." cf.cf_pos;
+						ctx.com.warning "@:java.native function definitions shouldn't include an expression. This behaviour is deprecated." cf.cf_pos;
 					cf.cf_expr <- None;
 					cf.cf_type <- t
 				| _ ->