Ver Fonte

[lua] fix check for bitops

Justin Donaldson há 6 anos atrás
pai
commit
229476be64
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      src/generators/genlua.ml

+ 6 - 0
src/generators/genlua.ml

@@ -2060,6 +2060,12 @@ let generate com =
     List.iter (transform_multireturn ctx) com.types;
     List.iter (generate_type ctx) com.types;
 
+    (* If bit ops are manually imported include the haxe wrapper for them *)
+    if has_feature ctx "use._bitop" then begin
+        print_file (Common.find_file com "lua/_lua/_hx_bit.lua");
+    end;
+
+    (* integer clamping is always required, and will use bit ops if available *)
     print_file (Common.find_file com "lua/_lua/_hx_bit_clamp.lua");
 
     (* Array is required, always patch it *)