From 651913f6d08e340c6d1f68b8fa3f64844cbd3d6b Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 25 Dec 2024 22:51:29 +0000 Subject: [PATCH] [hl] Respect hl-legacy32 for I64 arrays --- src/generators/genhl.ml | 2 +- std/hl/types/ArrayBase.hx | 2 ++ std/hl/types/ArrayBytes.hx | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/generators/genhl.ml b/src/generators/genhl.ml index 1a0106741cd..8562466104a 100644 --- a/src/generators/genhl.ml +++ b/src/generators/genhl.ml @@ -4153,7 +4153,7 @@ let create_context com dump = ai32 = get_class "ArrayBytes_Int"; af32 = get_class "ArrayBytes_hl_F32"; af64 = get_class "ArrayBytes_Float"; - ai64 = get_class "ArrayBytes_hl_I64"; + ai64 = get_class (if Gctx.raw_defined com "hl_legacy32" then "ArrayBytes_Int" else "ArrayBytes_hl_I64"); }; base_class = get_class "Class"; base_enum = get_class "Enum"; diff --git a/std/hl/types/ArrayBase.hx b/std/hl/types/ArrayBase.hx index ee27ea72369..b80369462c9 100644 --- a/std/hl/types/ArrayBase.hx +++ b/std/hl/types/ArrayBase.hx @@ -149,6 +149,7 @@ class ArrayBase extends ArrayAccess { return a; } + #if !hl_legacy32 public static function allocI64(bytes:BytesAccess, length:Int) @:privateAccess { var a:ArrayBytes.ArrayI64 = untyped $new(ArrayBytes.ArrayI64); a.length = length; @@ -156,4 +157,5 @@ class ArrayBase extends ArrayAccess { a.size = length; return a; } + #end } diff --git a/std/hl/types/ArrayBytes.hx b/std/hl/types/ArrayBytes.hx index 014c119be86..67940546935 100644 --- a/std/hl/types/ArrayBytes.hx +++ b/std/hl/types/ArrayBytes.hx @@ -362,4 +362,6 @@ typedef ArrayI32 = ArrayBytes; typedef ArrayUI16 = ArrayBytes; typedef ArrayF32 = ArrayBytes; typedef ArrayF64 = ArrayBytes; +#if !hl_legacy32 typedef ArrayI64 = ArrayBytes; +#end