diff --git a/.editorconfig b/.editorconfig index b69144a..0a950f8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -27,6 +27,10 @@ indent_size = 2 indent_style = tab indent_size = 2 +[*.odin] +indent_style = tab +indent_size = 2 + [*.ps1] indent_style = tab indent_size = 4 diff --git a/Odin/watl.v0.odin b/Odin/watl.v0.odin index 06511fb..9530882 100644 --- a/Odin/watl.v0.odin +++ b/Odin/watl.v0.odin @@ -6,6 +6,11 @@ Toolchain: odin-lang/Odin dev-2025-06 */ package odin +main :: proc() +{ + +} + import "base:builtin" import "base:intrinsics" @@ -103,29 +108,42 @@ sll_stack_push_n :: proc(first: ^$SLL_NodeType, n: ^SLL_NodeType) { first^ = n } sll_queue_push_nz :: proc(nil_val: ^$SLL_NodeType, first: ^SLL_NodeType, last: ^SLL_NodeType, n: ^SLL_NodeType) { - if first^ == nil_val { - first^ = n - last^ = n - n.next = nil_val - } else { - last^.next = n - last^ = n - n.next = nil_val - } + if first^ == nil_val { + first^ = n + last^ = n + n.next = nil_val + } else { + last^.next = n + last^ = n + n.next = nil_val + } } sll_queue_push_n :: proc(first: ^$SLL_NodeType, last: ^SLL_NodeType, n: ^SLL_NodeType) { sll_queue_push_nz(nil, first, last, n) } //#endregion("Memory") +//#region Allocator Interface +AllocatorOp :: enum u32 { + Alloc_NoZero = 0, // If Alloc exist, so must No_Zero + Alloc, + Free, + Reset, + Grow_NoZero, + Grow, + Shrink, + Rewind, + SavePoint, + Query, // Must always be implemented +} +AllocatorQueryFlag :: enum u64 { + +} +//#endregion Allocator Interface + //#region("Strings") Raw_String :: struct { data: [^]byte, len: int, } //#endregion("Strings") - -main :: proc() -{ - -} diff --git a/scripts/build.odin.ps1 b/scripts/build.odin.ps1 index 50a4c9c..9ee2437 100644 --- a/scripts/build.odin.ps1 +++ b/scripts/build.odin.ps1 @@ -23,6 +23,13 @@ $flag_optimize_none = '-o:none' $flag_output_path = '-out=' $flag_default_allocator_nil = '-default-to-nil-allocator' +$need_rebuild = $false +if (-not (test-path $exe)) { $need_rebuild = $true } +else { + $source_hash = (get-filehash $path_source -algorithm MD5).Hash + $exe_hash = (get-filehash $exe -algorithm MD5).Hash + if ($exe_hash -ne $source_hash) { $need_rebuild = $true } +} push-location $path_root $build_args = @() $build_args += $command_build @@ -36,6 +43,6 @@ $build_args += $flag_no_type_assert $build_args += $flag_dyn_map_calls $build_args += $flag_default_allocator_nil $build_args += $flag_output_path + $exe -# & $odin $build_args -& $exe +if ($need_rebuild) { & $odin $build_args } pop-location +& $exe