Skip to content

Commit

Permalink
[hl] Respect hl-legacy32 for I64 arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Dec 25, 2024
1 parent 9a7121e commit b364785
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/generators/genhl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions std/hl/types/ArrayBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,13 @@ class ArrayBase extends ArrayAccess {
return a;
}

#if !hl_legacy32
public static function allocI64(bytes:BytesAccess<I64>, length:Int) @:privateAccess {
var a:ArrayBytes.ArrayI64 = untyped $new(ArrayBytes.ArrayI64);
a.length = length;
a.bytes = bytes;
a.size = length;
return a;
}
#end
}
2 changes: 2 additions & 0 deletions std/hl/types/ArrayBytes.hx
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,6 @@ typedef ArrayI32 = ArrayBytes<Int>;
typedef ArrayUI16 = ArrayBytes<UI16>;
typedef ArrayF32 = ArrayBytes<F32>;
typedef ArrayF64 = ArrayBytes<Float>;
#if !hl_legacy32
typedef ArrayI64 = ArrayBytes<I64>;
#end

0 comments on commit b364785

Please sign in to comment.