Win32 Window Test

This commit is contained in:
gingerBill
2016-08-16 10:56:44 +01:00
parent dcbb2fcfbd
commit 0dd17fe843
14 changed files with 989 additions and 451 deletions
+2 -55
View File
@@ -1,15 +1,6 @@
// CRT
putchar :: proc(c: i32) -> i32 #foreign
heap_alloc :: proc(sz: int) -> rawptr #foreign "malloc"
heap_free :: proc(ptr: rawptr) #foreign "free"
mem_compare :: proc(dst, src : rawptr, len: int) -> i32 #foreign "memcmp"
mem_copy :: proc(dst, src : rawptr, len: int) -> i32 #foreign "memcpy"
mem_move :: proc(dst, src : rawptr, len: int) -> i32 #foreign "memmove"
debug_trap :: proc() #foreign "llvm.debugtrap"
#load "runtime.odin"
TWO_HEARTS :: '💕';
print_string :: proc(s: string) {
for i := 0; i < len(s); i++ {
@@ -137,47 +128,3 @@ print_bool :: proc(b : bool) {
}
}
// Runtime procedures
__string_eq :: proc(a, b : string) -> bool {
if len(a) != len(b) {
return false;
}
if ^a[0] == ^b[0] {
return true;
}
return mem_compare(^a[0], ^b[0], len(a)) == 0;
}
__string_ne :: proc(a, b : string) -> bool {
return !__string_eq(a, b);
}
__string_cmp :: proc(a, b : string) -> int {
min_len := len(a);
if len(b) < min_len {
min_len = len(b);
}
for i := 0; i < min_len; i++ {
x := a[i];
y := b[i];
if x < y {
return -1;
} else if x > y {
return +1;
}
}
if len(a) < len(b) {
return -1;
} else if len(a) > len(b) {
return +1;
}
return 0;
}
__string_lt :: proc(a, b : string) -> bool { return __string_cmp(a, b) < 0; }
__string_gt :: proc(a, b : string) -> bool { return __string_cmp(a, b) > 0; }
__string_le :: proc(a, b : string) -> bool { return __string_cmp(a, b) <= 0; }
__string_ge :: proc(a, b : string) -> bool { return __string_cmp(a, b) >= 0; }