fixed issue with memory_equal in builtin not resolving
authorJudah Caruso <judah@tuta.io>
Tue, 5 Dec 2023 20:27:48 +0000 (13:27 -0700)
committerJudah Caruso <judah@tuta.io>
Tue, 5 Dec 2023 20:27:48 +0000 (13:27 -0700)
core/operations.onyx

index d91592a1ad5cb1120708598ce00f164d55ef2924..9809adfccea075fc92d31095df84eaee27ca9a71 100644 (file)
@@ -1,7 +1,5 @@
 package builtin
 
-use core { intrinsics }
-
 //
 // This file contains builtin operator overloads.
 // It's in a separate file because we need to defer resolution of some definitions
@@ -28,9 +26,11 @@ use core { intrinsics }
 #operator * macro (l: [$N]$T, r: T) => __array_op_scalar(l, r, [a, b](a * b));
 #operator / macro (l: [$N]$T, r: T) => __array_op_scalar(l, r, [a, b](a / b));
 
-#operator == macro (l, r: [$N]$T) => intrinsics.wasm.memory_equal(cast(rawptr)l, cast(rawptr)r, N * sizeof T);
+#operator == macro (l, r: [$N]$T) => memory_equal(cast(rawptr)l, cast(rawptr)r, N * sizeof T);
 #operator != macro (l, r: [$N]$T) => !(l == r);
 
+memory_equal :: (a: rawptr, b: rawptr, count: i32) -> bool #intrinsic --- // So we don't have to include core.intrinsics
+
 __array_op_array :: macro (l, r: [$N]$T, $body: Code) -> [N]T {
     res: [N]T;
     for 0..N do res[it] = #unquote body(l[it], r[it]);