소스 검색

[lua] fix check for bitops

Justin Donaldson 6 년 전
부모
커밋
229476be64
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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 *)