Add comparisons to structs where all fields are comparable == and !=

This commit is contained in:
gingerBill
2020-11-23 12:20:04 +00:00
parent 4379917c7d
commit 9e42cb1595
7 changed files with 292 additions and 53 deletions
+3 -2
View File
@@ -180,8 +180,9 @@ mem_resize :: inline proc(ptr: rawptr, old_size, new_size: int, alignment: int =
}
return allocator.procedure(allocator.data, .Resize, new_size, alignment, ptr, old_size, 0, loc);
}
memory_equal :: proc "contextless" (a, b: rawptr, n: int) -> bool {
return memory_compare(a, b, n) == 0;
}
memory_compare :: proc "contextless" (a, b: rawptr, n: int) -> int #no_bounds_check {
x := uintptr(a);
y := uintptr(b);