From 8a62dfdf7feedeef2342d210d3fd0274aa4477d8 Mon Sep 17 00:00:00 2001 From: A1029384756 Date: Mon, 28 Sep 2026 11:23:20 -0400 Subject: [PATCH 01/17] [windows-cross-compile] initial commit --- base/runtime/os_specific_windows.odin | 4 +- core/sys/windows/bcrypt.odin | 2 +- core/sys/windows/gdi32.odin | 2 +- core/sys/windows/shell32.odin | 2 +- core/sys/windows/user32.odin | 2 +- core/sys/windows/winmm.odin | 2 +- src/linker.cpp | 90 +++++++++++++++++++-------- vendor/ENet/enet.odin | 4 +- vendor/portmidi/portmidi.odin | 2 +- vendor/raylib/raylib.odin | 8 +-- vendor/raylib/rlgl/rlgl.odin | 8 +-- 11 files changed, 82 insertions(+), 44 deletions(-) diff --git a/base/runtime/os_specific_windows.odin b/base/runtime/os_specific_windows.odin index d938e87ea..1fee46090 100644 --- a/base/runtime/os_specific_windows.odin +++ b/base/runtime/os_specific_windows.odin @@ -2,7 +2,7 @@ #+private package runtime -foreign import bcrypt "system:Bcrypt.lib" +foreign import bcrypt "system:bcrypt.lib" foreign import kernel32 "system:Kernel32.lib" _HAS_RAND_BYTES :: true @@ -87,4 +87,4 @@ _rand_bytes :: proc "contextless" (dst: []byte) { _exit :: proc "contextless" (code: int) -> ! { ExitProcess(u32(code)) -} \ No newline at end of file +} diff --git a/core/sys/windows/bcrypt.odin b/core/sys/windows/bcrypt.odin index f15f1e305..aee361752 100644 --- a/core/sys/windows/bcrypt.odin +++ b/core/sys/windows/bcrypt.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import bcrypt "system:Bcrypt.lib" +foreign import bcrypt "system:bcrypt.lib" BCRYPT_USE_SYSTEM_PREFERRED_RNG: DWORD : 0x00000002 diff --git a/core/sys/windows/gdi32.odin b/core/sys/windows/gdi32.odin index b11589d41..46c580b3f 100644 --- a/core/sys/windows/gdi32.odin +++ b/core/sys/windows/gdi32.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import gdi32 "system:Gdi32.lib" +foreign import gdi32 "system:Gdi32.Lib" @(default_calling_convention="system") foreign gdi32 { diff --git a/core/sys/windows/shell32.odin b/core/sys/windows/shell32.odin index 0fdcc69d7..d75254ef0 100644 --- a/core/sys/windows/shell32.odin +++ b/core/sys/windows/shell32.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import shell32 "system:Shell32.lib" +foreign import shell32 "system:shell32.lib" @(default_calling_convention="system") foreign shell32 { diff --git a/core/sys/windows/user32.odin b/core/sys/windows/user32.odin index 75ed1e91b..6d28626e3 100644 --- a/core/sys/windows/user32.odin +++ b/core/sys/windows/user32.odin @@ -2,7 +2,7 @@ package sys_windows import "base:intrinsics" -foreign import user32 "system:User32.lib" +foreign import user32 "system:User32.Lib" @(default_calling_convention="system") foreign user32 { diff --git a/core/sys/windows/winmm.odin b/core/sys/windows/winmm.odin index d1848cb7b..86bc36ff3 100644 --- a/core/sys/windows/winmm.odin +++ b/core/sys/windows/winmm.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import winmm "system:Winmm.lib" +foreign import winmm "system:WinMM.Lib" MMRESULT :: UINT diff --git a/src/linker.cpp b/src/linker.cpp index 0d8fa79e0..71a55d214 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -131,13 +131,21 @@ gb_internal i32 linker_stage(LinkerData *gen) { return result; } - bool is_cross_linking = false; bool is_android = false; - - if (build_context.cross_compiling && (build_context.different_os || selected_subtarget != Subtarget_Default)) { + bool is_windows_cross = false; + if (build_context.cross_compiling && build_context.different_os && build_context.metrics.os == TargetOs_windows) { + if (build_context.linker_choice != Linker_lld) { + gb_printf_err("Cannot link for Windows without LLD (%.*s %.*s)\n", + LIT(target_os_names[build_context.metrics.os]), + LIT(target_arch_names[build_context.metrics.arch]) + ); + build_context.keep_object_files = true; + } + is_windows_cross = true; + goto try_cross_linking; + } else if (build_context.cross_compiling && (build_context.different_os || selected_subtarget != Subtarget_Default)) { switch (selected_subtarget) { case Subtarget_Android: - is_cross_linking = true; is_android = true; goto try_cross_linking; default: @@ -156,7 +164,7 @@ try_cross_linking:; bool is_windows = build_context.metrics.os == TargetOs_windows; #else String section_name = str_lit("ld-link"); - bool is_windows = false; + bool is_windows = is_windows_cross; #endif bool is_osx = build_context.metrics.os == TargetOs_darwin; @@ -250,13 +258,27 @@ try_cross_linking:; obj_format = str_lit("win32"); #endif + #if defined(GB_SYSTEM_WINDOWS) + char nasm_path[4096] = {0}; + gb_snprintf_va( + nasm_path, + gb_count_of(nasm_path) - 1, + "%.*s\\bin\\nasm\\windows\\nasm.exe", + LIT(build_context.ODIN_ROOT), + ); + #else + const char *nasm_path = gb_get_env("ODIN_NASM_PATH", permanent_allocator()); + if (nasm_path == nullptr) { + nasm_path = "nasm"; + } + #endif result = system_exec_command_line_app("nasm", - "\"%.*s\\bin\\nasm\\windows\\nasm.exe\" \"%.*s\" " + "\"%s\" \"%.*s\" " "-f \"%.*s\" " "-o \"%.*s\" " "%.*s " "", - LIT(build_context.ODIN_ROOT), LIT(asm_file), + nasm_path, LIT(asm_file), LIT(obj_format), LIT(obj_file), LIT(build_context.extra_assembler_flags) @@ -327,27 +349,43 @@ try_cross_linking:; switch (build_context.linker_choice) { case Linker_lld: - result = system_exec_command_line_app("msvc-lld-link", - "\"%.*s\\bin\\lld-link\" %s -OUT:\"%.*s\" %s " - "/nologo /incremental:no /opt:ref /subsystem:%.*s " - "%.*s " - "%.*s " - "%s " - "%s " - "", - LIT(build_context.ODIN_ROOT), object_files, LIT(output_filename), - link_settings, - LIT(windows_subsystem_names[build_context.ODIN_WINDOWS_SUBSYSTEM]), - LIT(build_context.link_flags), - LIT(build_context.extra_linker_flags), - lib_str, - lld_lto_flags - ); + { + #if defined(GB_SYSTEM_WINDOWS) + char linker_path[4096] = {0}; + gb_snprintf( + linker_path, + gb_count_of(buf) - 1, + "%.*s\\bin\\lld-link", + LIT(build_context.ODIN_ROOT) + ); + #else + const char *linker_path = gb_get_env("ODIN_LLD_PATH", permanent_allocator()); + if (linker_path == nullptr) { + linker_path = "lld-link"; + } + #endif + result = system_exec_command_line_app("lld-link", + "\"%s\" %s -OUT:\"%.*s\" %s " + "/nologo /incremental:no /opt:ref /subsystem:%.*s " + "%.*s " + "%.*s " + "%s " + "%s " + "", + linker_path, object_files, LIT(output_filename), + link_settings, + LIT(windows_subsystem_names[build_context.ODIN_WINDOWS_SUBSYSTEM]), + LIT(build_context.link_flags), + LIT(build_context.extra_linker_flags), + lib_str, + lld_lto_flags + ); - if (result) { - return result; + if (result) { + return result; + } + break; } - break; case Linker_radlink: result = system_exec_command_line_app("msvc-rad-link", "\"%.*s\\bin\\radlink\" %s -OUT:\"%.*s\" %s " diff --git a/vendor/ENet/enet.odin b/vendor/ENet/enet.odin index 235cc5684..775cecf90 100644 --- a/vendor/ENet/enet.odin +++ b/vendor/ENet/enet.odin @@ -6,13 +6,13 @@ when ODIN_OS == .Windows { foreign import ENet { "lib/enet64.lib", "system:Ws2_32.lib", - "system:Winmm.lib", + "system:WinMM.Lib", } } else { foreign import ENet { "lib/enet.lib", "system:Ws2_32.lib", - "system:Winmm.lib", + "system:WinMM.Lib", } } } else { diff --git a/vendor/portmidi/portmidi.odin b/vendor/portmidi/portmidi.odin index 1f2aca286..582093cc5 100644 --- a/vendor/portmidi/portmidi.odin +++ b/vendor/portmidi/portmidi.odin @@ -11,7 +11,7 @@ when ODIN_OS == .Windows { } else { foreign import lib { "portmidi_s.lib", - "system:Winmm.lib", + "system:WinMM.Lib", "system:Advapi32.lib", } } diff --git a/vendor/raylib/raylib.odin b/vendor/raylib/raylib.odin index 64321e020..087b88a77 100644 --- a/vendor/raylib/raylib.odin +++ b/vendor/raylib/raylib.odin @@ -103,10 +103,10 @@ when ODIN_OS == .Windows { @(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt")) foreign import lib { "windows/raylibdll.lib" when RAYLIB_SHARED else "windows/raylib.lib" , - "system:Winmm.lib", - "system:Gdi32.lib", - "system:User32.lib", - "system:Shell32.lib", + "system:WinMM.Lib", + "system:Gdi32.Lib", + "system:User32.Lib", + "system:shell32.lib", } } else when ODIN_OS == .Linux { when ODIN_ARCH == .arm64 { diff --git a/vendor/raylib/rlgl/rlgl.odin b/vendor/raylib/rlgl/rlgl.odin index 0655a4073..1e5240430 100644 --- a/vendor/raylib/rlgl/rlgl.odin +++ b/vendor/raylib/rlgl/rlgl.odin @@ -123,10 +123,10 @@ when ODIN_OS == .Windows { @(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt")) foreign import lib { "../windows/raylibdll.lib" when RAYLIB_SHARED else "../windows/raylib.lib" , - "system:Winmm.lib", - "system:Gdi32.lib", - "system:User32.lib", - "system:Shell32.lib", + "system:WinMM.Lib", + "system:Gdi32.Lib", + "system:User32.Lib", + "system:shell32.lib", } } else when ODIN_OS == .Linux { when ODIN_ARCH == .arm64 { From 4e00758c640365721a4b7294ffec69e2855b9b77 Mon Sep 17 00:00:00 2001 From: A1029384756 Date: Mon, 28 Sep 2026 11:27:28 -0400 Subject: [PATCH 02/17] [windows-cross-compile] improve strictness --- src/linker.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/linker.cpp b/src/linker.cpp index 71a55d214..556f16001 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -140,9 +140,10 @@ gb_internal i32 linker_stage(LinkerData *gen) { LIT(target_arch_names[build_context.metrics.arch]) ); build_context.keep_object_files = true; + } else { + is_windows_cross = true; + goto try_cross_linking; } - is_windows_cross = true; - goto try_cross_linking; } else if (build_context.cross_compiling && (build_context.different_os || selected_subtarget != Subtarget_Default)) { switch (selected_subtarget) { case Subtarget_Android: @@ -230,7 +231,9 @@ try_cross_linking:; String lib = string_trim_whitespace(e->LibraryName.paths[i]); // IMPORTANT NOTE(bill): calling `string_to_lower` here is not an issue because // we will never uses these strings afterwards + #if defined(GB_SYSTEM_WINDOWS) string_to_lower(&lib); + #endif if (lib.len == 0) { continue; } From d89d196695c65bb32266ebf3de43702f4b0fda76 Mon Sep 17 00:00:00 2001 From: A1029384756 Date: Mon, 28 Sep 2026 11:39:35 -0400 Subject: [PATCH 03/17] [windows-cross-compile] windows build fixes --- src/linker.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/linker.cpp b/src/linker.cpp index 556f16001..672101a1f 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -263,11 +263,11 @@ try_cross_linking:; #if defined(GB_SYSTEM_WINDOWS) char nasm_path[4096] = {0}; - gb_snprintf_va( + gb_snprintf( nasm_path, gb_count_of(nasm_path) - 1, "%.*s\\bin\\nasm\\windows\\nasm.exe", - LIT(build_context.ODIN_ROOT), + LIT(build_context.ODIN_ROOT) ); #else const char *nasm_path = gb_get_env("ODIN_NASM_PATH", permanent_allocator()); @@ -357,7 +357,7 @@ try_cross_linking:; char linker_path[4096] = {0}; gb_snprintf( linker_path, - gb_count_of(buf) - 1, + gb_count_of(linker_path) - 1, "%.*s\\bin\\lld-link", LIT(build_context.ODIN_ROOT) ); From 967736fe6657d8c433b52a360900131dd81f1bdc Mon Sep 17 00:00:00 2001 From: A1029384756 Date: Mon, 28 Sep 2026 15:58:14 -0400 Subject: [PATCH 04/17] [windows-cross-compile] permissive name matching --- src/build_settings.cpp | 2 ++ src/linker.cpp | 49 ++++++++++++++++++++++++++++++++++++------ src/main.cpp | 22 +++++++++++++++++++ 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 8d5b7849b..103737ead 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -665,6 +665,8 @@ struct BuildContext { String android_keystore; String android_keystore_alias; String android_keystore_password; + + String windows_sdk_root; }; gb_global BuildContext build_context = {0}; diff --git a/src/linker.cpp b/src/linker.cpp index 672101a1f..c02b4fa6d 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -133,7 +133,7 @@ gb_internal i32 linker_stage(LinkerData *gen) { bool is_android = false; bool is_windows_cross = false; - if (build_context.cross_compiling && build_context.different_os && build_context.metrics.os == TargetOs_windows) { + if (build_context.cross_compiling && build_context.metrics.os == TargetOs_windows) { if (build_context.linker_choice != Linker_lld) { gb_printf_err("Cannot link for Windows without LLD (%.*s %.*s)\n", LIT(target_os_names[build_context.metrics.os]), @@ -220,6 +220,29 @@ try_cross_linking:; string_set_init(&asm_files, 64); defer (string_set_destroy(&asm_files)); + #if !defined(GB_SYSTEM_WINDOWS) + StringMap libs_normalized = {}; + string_map_init(&libs_normalized); + defer (string_map_destroy(&libs_normalized)); + Array walker_list = {}; + ReadDirectoryError rd_err = read_directory(build_context.windows_sdk_root, &walker_list); + for_array(i, walker_list) { + FileInfo entry = walker_list[i]; + if (entry.is_dir) { + Array walker_children = {}; + ReadDirectoryError child_rd_err = read_directory(entry.fullpath, &walker_children); + for_array(j, walker_children) { + array_add(&walker_list, walker_children[j]); + } + array_free(&walker_children); + continue; + } + String lowered_name = copy_string(permanent_allocator(), entry.name); + string_to_lower(&lowered_name); + string_map_set(&libs_normalized, lowered_name, entry.name); + } + #endif + for (Entity *e : gen->foreign_libraries) { GB_ASSERT(e->kind == Entity_LibraryName); // NOTE(bill): Add these before the linking values @@ -229,15 +252,25 @@ try_cross_linking:; } for_array(i, e->LibraryName.paths) { String lib = string_trim_whitespace(e->LibraryName.paths[i]); - // IMPORTANT NOTE(bill): calling `string_to_lower` here is not an issue because - // we will never uses these strings afterwards - #if defined(GB_SYSTEM_WINDOWS) - string_to_lower(&lib); - #endif if (lib.len == 0) { continue; } + #if defined(GB_SYSTEM_WINDOWS) + // IMPORTANT NOTE(bill): calling `string_to_lower` here is not an issue because + // we will never uses these strings afterwards + string_to_lower(&lib); + #else + if (lib[0] != '/') { + String lowered_name = copy_string(permanent_allocator(), lib); + string_to_lower(&lowered_name); + String *fixed_lib = string_map_get(&libs_normalized, lowered_name); + if (fixed_lib != nullptr) { + lib = *fixed_lib; + } + } + #endif + if (has_asm_extension(lib)) { if (!string_set_update(&asm_files, lib)) { String asm_file = lib; @@ -328,6 +361,10 @@ try_cross_linking:; } } + if (build_context.windows_sdk_root.len > 0) { + link_settings = gb_string_append_fmt(link_settings, " /winsysroot:%.*s", LIT(build_context.windows_sdk_root)); + } + if (build_context.ODIN_DEBUG) { link_settings = gb_string_append_fmt(link_settings, " /DEBUG"); } diff --git a/src/main.cpp b/src/main.cpp index 3605717e7..09a80a570 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -545,6 +545,10 @@ enum BuildFlagKind { BuildFlag_AndroidKeystoreAlias, BuildFlag_AndroidKeystorePassword, +#if !defined(GB_SYSTEM_WINDOWS) + BuildFlag_WindowsSDKRoot, +#endif + BuildFlag_COUNT, }; @@ -807,6 +811,10 @@ gb_internal bool parse_build_flags(Array args) { add_flag(&build_flags, BuildFlag_AndroidKeystoreAlias, str_lit("android-keystore-alias"), BuildFlagParam_String, Command_bundle_android); add_flag(&build_flags, BuildFlag_AndroidKeystorePassword, str_lit("android-keystore-password"), BuildFlagParam_String, Command_bundle_android); +#if !defined(GB_SYSTEM_WINDOWS) + add_flag(&build_flags, BuildFlag_WindowsSDKRoot, str_lit("windows-sdk-root"), BuildFlagParam_String, Command_build); +#endif + Array flag_args = {}; @@ -2001,6 +2009,13 @@ gb_internal bool parse_build_flags(Array args) { GB_ASSERT(value.kind == ExactValue_String); build_context.android_keystore_password = value.value_string; break; + + #if !defined(GB_SYSTEM_WINDOWS) + case BuildFlag_WindowsSDKRoot: + GB_ASSERT(value.kind == ExactValue_String); + build_context.windows_sdk_root = value.value_string; + break; + #endif } } @@ -4203,6 +4218,13 @@ int main(int arg_count, char const **arg_ptr) { // return 1; // } +#if !defined(GB_SYSTEM_WINDOWS) + if (build_context.metrics.os == TargetOs_windows && build_context.windows_sdk_root.len == 0) { + gb_printf_err("-windows-sdk-root: must be used to target Windows\n"); + gb_exit(1); + } +#endif + // Warn about Windows i386 thread-local storage limitations if (build_context.metrics.arch == TargetArch_i386 && build_context.metrics.os == TargetOs_windows) { gb_printf_err("Warning: Thread-local storage is disabled on Windows i386.\n"); From 25e805f479bed6f637c9c8c13b0e21f92fa61f54 Mon Sep 17 00:00:00 2001 From: A1029384756 Date: Mon, 28 Sep 2026 16:01:49 -0400 Subject: [PATCH 05/17] [windows-cross-compile] restore foreign import names --- base/runtime/os_specific_windows.odin | 2 +- core/sys/windows/bcrypt.odin | 2 +- core/sys/windows/gdi32.odin | 2 +- core/sys/windows/shell32.odin | 2 +- core/sys/windows/user32.odin | 2 +- core/sys/windows/winmm.odin | 2 +- vendor/ENet/enet.odin | 4 ++-- vendor/glfw/bindings/bindings.odin | 4 ++-- vendor/portmidi/portmidi.odin | 2 +- vendor/raylib/raylib.odin | 8 ++++---- vendor/raylib/rlgl/rlgl.odin | 8 ++++---- vendor/wgpu/wgpu.odin | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/base/runtime/os_specific_windows.odin b/base/runtime/os_specific_windows.odin index 1fee46090..788ff42fc 100644 --- a/base/runtime/os_specific_windows.odin +++ b/base/runtime/os_specific_windows.odin @@ -2,7 +2,7 @@ #+private package runtime -foreign import bcrypt "system:bcrypt.lib" +foreign import Bcrypt "system:bcrypt.lib" foreign import kernel32 "system:Kernel32.lib" _HAS_RAND_BYTES :: true diff --git a/core/sys/windows/bcrypt.odin b/core/sys/windows/bcrypt.odin index aee361752..643c8cfde 100644 --- a/core/sys/windows/bcrypt.odin +++ b/core/sys/windows/bcrypt.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import bcrypt "system:bcrypt.lib" +foreign import Bcrypt "system:bcrypt.lib" BCRYPT_USE_SYSTEM_PREFERRED_RNG: DWORD : 0x00000002 diff --git a/core/sys/windows/gdi32.odin b/core/sys/windows/gdi32.odin index 46c580b3f..b11589d41 100644 --- a/core/sys/windows/gdi32.odin +++ b/core/sys/windows/gdi32.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import gdi32 "system:Gdi32.Lib" +foreign import gdi32 "system:Gdi32.lib" @(default_calling_convention="system") foreign gdi32 { diff --git a/core/sys/windows/shell32.odin b/core/sys/windows/shell32.odin index d75254ef0..c89b1e773 100644 --- a/core/sys/windows/shell32.odin +++ b/core/sys/windows/shell32.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import shell32 "system:shell32.lib" +foreign import Shell32 "system:shell32.lib" @(default_calling_convention="system") foreign shell32 { diff --git a/core/sys/windows/user32.odin b/core/sys/windows/user32.odin index 6d28626e3..75ed1e91b 100644 --- a/core/sys/windows/user32.odin +++ b/core/sys/windows/user32.odin @@ -2,7 +2,7 @@ package sys_windows import "base:intrinsics" -foreign import user32 "system:User32.Lib" +foreign import user32 "system:User32.lib" @(default_calling_convention="system") foreign user32 { diff --git a/core/sys/windows/winmm.odin b/core/sys/windows/winmm.odin index 86bc36ff3..d1848cb7b 100644 --- a/core/sys/windows/winmm.odin +++ b/core/sys/windows/winmm.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import winmm "system:WinMM.Lib" +foreign import winmm "system:Winmm.lib" MMRESULT :: UINT diff --git a/vendor/ENet/enet.odin b/vendor/ENet/enet.odin index 775cecf90..235cc5684 100644 --- a/vendor/ENet/enet.odin +++ b/vendor/ENet/enet.odin @@ -6,13 +6,13 @@ when ODIN_OS == .Windows { foreign import ENet { "lib/enet64.lib", "system:Ws2_32.lib", - "system:WinMM.Lib", + "system:Winmm.lib", } } else { foreign import ENet { "lib/enet.lib", "system:Ws2_32.lib", - "system:WinMM.Lib", + "system:Winmm.lib", } } } else { diff --git a/vendor/glfw/bindings/bindings.odin b/vendor/glfw/bindings/bindings.odin index 3f2f08237..5ffe94926 100644 --- a/vendor/glfw/bindings/bindings.odin +++ b/vendor/glfw/bindings/bindings.odin @@ -11,14 +11,14 @@ when ODIN_OS == .Windows { "../lib/glfw3dll.lib", "system:user32.lib", "system:gdi32.lib", - "system:shell32.lib", + "system:Shell32.lib", } } else { foreign import glfw { "../lib/glfw3_mt.lib", "system:user32.lib", "system:gdi32.lib", - "system:shell32.lib", + "system:Shell32.lib", } } } else when ODIN_OS == .Darwin { diff --git a/vendor/portmidi/portmidi.odin b/vendor/portmidi/portmidi.odin index 582093cc5..1f2aca286 100644 --- a/vendor/portmidi/portmidi.odin +++ b/vendor/portmidi/portmidi.odin @@ -11,7 +11,7 @@ when ODIN_OS == .Windows { } else { foreign import lib { "portmidi_s.lib", - "system:WinMM.Lib", + "system:Winmm.lib", "system:Advapi32.lib", } } diff --git a/vendor/raylib/raylib.odin b/vendor/raylib/raylib.odin index 087b88a77..64321e020 100644 --- a/vendor/raylib/raylib.odin +++ b/vendor/raylib/raylib.odin @@ -103,10 +103,10 @@ when ODIN_OS == .Windows { @(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt")) foreign import lib { "windows/raylibdll.lib" when RAYLIB_SHARED else "windows/raylib.lib" , - "system:WinMM.Lib", - "system:Gdi32.Lib", - "system:User32.Lib", - "system:shell32.lib", + "system:Winmm.lib", + "system:Gdi32.lib", + "system:User32.lib", + "system:Shell32.lib", } } else when ODIN_OS == .Linux { when ODIN_ARCH == .arm64 { diff --git a/vendor/raylib/rlgl/rlgl.odin b/vendor/raylib/rlgl/rlgl.odin index 1e5240430..0655a4073 100644 --- a/vendor/raylib/rlgl/rlgl.odin +++ b/vendor/raylib/rlgl/rlgl.odin @@ -123,10 +123,10 @@ when ODIN_OS == .Windows { @(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt")) foreign import lib { "../windows/raylibdll.lib" when RAYLIB_SHARED else "../windows/raylib.lib" , - "system:WinMM.Lib", - "system:Gdi32.Lib", - "system:User32.Lib", - "system:shell32.lib", + "system:Winmm.lib", + "system:Gdi32.lib", + "system:User32.lib", + "system:Shell32.lib", } } else when ODIN_OS == .Linux { when ODIN_ARCH == .arm64 { diff --git a/vendor/wgpu/wgpu.odin b/vendor/wgpu/wgpu.odin index 1a7930c10..adfce0e44 100644 --- a/vendor/wgpu/wgpu.odin +++ b/vendor/wgpu/wgpu.odin @@ -22,7 +22,7 @@ when ODIN_OS == .Windows { "system:d3dcompiler.lib", "system:ws2_32.lib", "system:userenv.lib", - "system:bcrypt.lib", + "system:Bcrypt.lib", "system:ntdll.lib", "system:opengl32.lib", "system:advapi32.lib", From 08a9f18675b178e64f96f42fb226a1b53c8eebc8 Mon Sep 17 00:00:00 2001 From: A1029384756 Date: Mon, 28 Sep 2026 16:03:43 -0400 Subject: [PATCH 06/17] [windows-cross-compile] fix cdo mistakes --- base/runtime/os_specific_windows.odin | 2 +- core/sys/windows/bcrypt.odin | 2 +- core/sys/windows/shell32.odin | 2 +- vendor/glfw/bindings/bindings.odin | 4 ++-- vendor/wgpu/wgpu.odin | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/base/runtime/os_specific_windows.odin b/base/runtime/os_specific_windows.odin index 788ff42fc..83451bd65 100644 --- a/base/runtime/os_specific_windows.odin +++ b/base/runtime/os_specific_windows.odin @@ -2,7 +2,7 @@ #+private package runtime -foreign import Bcrypt "system:bcrypt.lib" +foreign import bcrypt "system:Bcrypt.lib" foreign import kernel32 "system:Kernel32.lib" _HAS_RAND_BYTES :: true diff --git a/core/sys/windows/bcrypt.odin b/core/sys/windows/bcrypt.odin index 643c8cfde..f15f1e305 100644 --- a/core/sys/windows/bcrypt.odin +++ b/core/sys/windows/bcrypt.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import Bcrypt "system:bcrypt.lib" +foreign import bcrypt "system:Bcrypt.lib" BCRYPT_USE_SYSTEM_PREFERRED_RNG: DWORD : 0x00000002 diff --git a/core/sys/windows/shell32.odin b/core/sys/windows/shell32.odin index c89b1e773..0fdcc69d7 100644 --- a/core/sys/windows/shell32.odin +++ b/core/sys/windows/shell32.odin @@ -1,7 +1,7 @@ #+build windows package sys_windows -foreign import Shell32 "system:shell32.lib" +foreign import shell32 "system:Shell32.lib" @(default_calling_convention="system") foreign shell32 { diff --git a/vendor/glfw/bindings/bindings.odin b/vendor/glfw/bindings/bindings.odin index 5ffe94926..3f2f08237 100644 --- a/vendor/glfw/bindings/bindings.odin +++ b/vendor/glfw/bindings/bindings.odin @@ -11,14 +11,14 @@ when ODIN_OS == .Windows { "../lib/glfw3dll.lib", "system:user32.lib", "system:gdi32.lib", - "system:Shell32.lib", + "system:shell32.lib", } } else { foreign import glfw { "../lib/glfw3_mt.lib", "system:user32.lib", "system:gdi32.lib", - "system:Shell32.lib", + "system:shell32.lib", } } } else when ODIN_OS == .Darwin { diff --git a/vendor/wgpu/wgpu.odin b/vendor/wgpu/wgpu.odin index adfce0e44..1a7930c10 100644 --- a/vendor/wgpu/wgpu.odin +++ b/vendor/wgpu/wgpu.odin @@ -22,7 +22,7 @@ when ODIN_OS == .Windows { "system:d3dcompiler.lib", "system:ws2_32.lib", "system:userenv.lib", - "system:Bcrypt.lib", + "system:bcrypt.lib", "system:ntdll.lib", "system:opengl32.lib", "system:advapi32.lib", From 7ba772f31168354412a60b4f2a04d58d4296d402 Mon Sep 17 00:00:00 2001 From: A1029384756 Date: Mon, 28 Sep 2026 16:05:52 -0400 Subject: [PATCH 07/17] [windows-cross-compile] fix newlines --- base/runtime/os_specific_windows.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/runtime/os_specific_windows.odin b/base/runtime/os_specific_windows.odin index 83451bd65..d938e87ea 100644 --- a/base/runtime/os_specific_windows.odin +++ b/base/runtime/os_specific_windows.odin @@ -87,4 +87,4 @@ _rand_bytes :: proc "contextless" (dst: []byte) { _exit :: proc "contextless" (code: int) -> ! { ExitProcess(u32(code)) -} +} \ No newline at end of file From 2f7a2b52465138fbd9aa50d58d1d7f71b0061504 Mon Sep 17 00:00:00 2001 From: A1029384756 Date: Mon, 28 Sep 2026 16:22:17 -0400 Subject: [PATCH 08/17] [windows-cross-compile] don't require `lld` when cross-arch windows --- src/linker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linker.cpp b/src/linker.cpp index c02b4fa6d..601c4b975 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -133,7 +133,7 @@ gb_internal i32 linker_stage(LinkerData *gen) { bool is_android = false; bool is_windows_cross = false; - if (build_context.cross_compiling && build_context.metrics.os == TargetOs_windows) { + if (build_context.cross_compiling && build_context.different_os && build_context.metrics.os == TargetOs_windows) { if (build_context.linker_choice != Linker_lld) { gb_printf_err("Cannot link for Windows without LLD (%.*s %.*s)\n", LIT(target_os_names[build_context.metrics.os]), From e5b8ea0d2a986dbba2ddc515495fe55f4e1b12b4 Mon Sep 17 00:00:00 2001 From: bplu4t2f Date: Sun, 4 Oct 2026 14:09:47 +0200 Subject: [PATCH 09/17] Add test for issue #7689 --- .../test_issue_7689/test_issue_7689.odin | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/issues/test_issue_7689/test_issue_7689.odin diff --git a/tests/issues/test_issue_7689/test_issue_7689.odin b/tests/issues/test_issue_7689/test_issue_7689.odin new file mode 100644 index 000000000..7b39cdd99 --- /dev/null +++ b/tests/issues/test_issue_7689/test_issue_7689.odin @@ -0,0 +1,21 @@ +package bug_repro + +import "core:fmt" +import "core:os" + +main :: proc() { + x := len(os.args)+1 // runtime value so nothing is folded + + r: int + if x == 1 { + r = 1 + } else if x == 2 { + r = 2 + } else if x == 3 { + r = 3 + } else if x == 4 { + r = 4 + } + + fmt.println(r) +} From 854cd0e8d8f7d2b213f8750e840ff66b4715282e Mon Sep 17 00:00:00 2001 From: bplu4t2f Date: Sun, 4 Oct 2026 14:44:34 +0200 Subject: [PATCH 10/17] Fix #7689 - set debug source location of if/else "done" jump to end of the respective block --- src/llvm_backend_stmt.cpp | 12 ++++++++++++ .../test_issue_7689/test_issue_7689.odin | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/llvm_backend_stmt.cpp b/src/llvm_backend_stmt.cpp index d35b48835..727bdbf43 100644 --- a/src/llvm_backend_stmt.cpp +++ b/src/llvm_backend_stmt.cpp @@ -2912,6 +2912,9 @@ gb_internal void lb_build_if_stmt(lbProcedure *p, Ast *node) { lb_start_block(p, then); lb_build_stmt(p, is->body); + if (p->debug_info != nullptr) { + LLVMSetCurrentDebugLocation2(p->builder, lb_debug_end_location_from_ast(p, is->body)); + } lb_emit_jump(p, done); } else { if (is->else_stmt != nullptr) { @@ -2921,6 +2924,9 @@ gb_internal void lb_build_if_stmt(lbProcedure *p, Ast *node) { lb_open_scope(p, scope_of_node(is->else_stmt)); lb_build_stmt(p, is->else_stmt); lb_close_scope(p, lbDeferExit_Default, nullptr, is->else_stmt); + if (p->debug_info != nullptr) { + LLVMSetCurrentDebugLocation2(p->builder, lb_debug_end_location_from_ast(p, is->else_stmt)); + } } lb_emit_jump(p, done); @@ -2929,6 +2935,9 @@ gb_internal void lb_build_if_stmt(lbProcedure *p, Ast *node) { lb_start_block(p, then); lb_build_stmt(p, is->body); + if (p->debug_info != nullptr) { + LLVMSetCurrentDebugLocation2(p->builder, lb_debug_end_location_from_ast(p, is->body)); + } lb_emit_jump(p, done); @@ -2938,6 +2947,9 @@ gb_internal void lb_build_if_stmt(lbProcedure *p, Ast *node) { lb_open_scope(p, scope_of_node(is->else_stmt)); lb_build_stmt(p, is->else_stmt); lb_close_scope(p, lbDeferExit_Default, nullptr, is->else_stmt); + if (p->debug_info != nullptr) { + LLVMSetCurrentDebugLocation2(p->builder, lb_debug_end_location_from_ast(p, is->else_stmt)); + } lb_emit_jump(p, done); } diff --git a/tests/issues/test_issue_7689/test_issue_7689.odin b/tests/issues/test_issue_7689/test_issue_7689.odin index 7b39cdd99..091ae9f56 100644 --- a/tests/issues/test_issue_7689/test_issue_7689.odin +++ b/tests/issues/test_issue_7689/test_issue_7689.odin @@ -9,12 +9,18 @@ main :: proc() { r: int if x == 1 { r = 1 - } else if x == 2 { - r = 2 - } else if x == 3 { - r = 3 - } else if x == 4 { - r = 4 + } else { + if x == 2 { + r = 2 + } else { + if x == 3 { + r = 3 + } else { + if x == 4 { + r = 4 + } + } + } } fmt.println(r) From 2b82056df27296851cf60281855538a7aff0e764 Mon Sep 17 00:00:00 2001 From: Matthias Huerbe Date: Sun, 4 Oct 2026 22:08:37 +0200 Subject: [PATCH 11/17] Fix -linker:radlink being rejected on Windows --- src/build_settings.cpp | 2 +- src/linker.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/build_settings.cpp b/src/build_settings.cpp index af5576011..8a6bb7ffe 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -2346,7 +2346,7 @@ gb_internal bool init_build_paths(String init_filename) { return false; } - if (build_context.linker_choice == Linker_Default && find_result.vs_exe_path.len == 0) { + if (build_context.linker_choice == Linker_msvc && find_result.vs_exe_path.len == 0) { gb_printf_err("link.exe not found.\n"); return false; } diff --git a/src/linker.cpp b/src/linker.cpp index 643a9a4d0..7a36a7946 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -69,7 +69,7 @@ gb_internal i32 system_exec_msvc_linker_app(char const *name, char const *fmt, . gb_printf_err("Failed to create linker response file: %s\n", rsp_path); return -1; } - if (build_context.linker_choice != Linker_radlink) { + if (build_context.linker_choice != Linker_Default && build_context.linker_choice != Linker_radlink) { // NOTE(bill): link.exe reads a response file without a BOM in the ANSI code page but radlink does not skip a BOM gb_file_write(&f, "\xef\xbb\xbf", 3); } @@ -244,6 +244,9 @@ try_cross_linking:; switch (build_context.linker_choice) { case Linker_Default: break; case Linker_lld: section_name = str_lit("lld-link"); break; + #if defined(GB_SYSTEM_WINDOWS) + case Linker_radlink: break; + #endif #if defined(GB_SYSTEM_LINUX) || defined(GB_SYSTEM_FREEBSD) || defined(GB_SYSTEM_NETBSD) case Linker_mold: section_name = str_lit("mold-link"); break; #endif From 6fd8888986e5458456912f66dfd168defdfd407a Mon Sep 17 00:00:00 2001 From: Alexander Zhura Date: Mon, 5 Oct 2026 10:03:06 +0300 Subject: [PATCH 12/17] Impl simd x86 sse2 _mm_insert_epi16 fix --- core/simd/x86/sse2.odin | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/simd/x86/sse2.odin b/core/simd/x86/sse2.odin index 4c231c377..fba995720 100644 --- a/core/simd/x86/sse2.odin +++ b/core/simd/x86/sse2.odin @@ -482,10 +482,15 @@ _mm_packus_epi16 :: #force_inline proc "c" (a, b: __m128i) -> __m128i { _mm_extract_epi16 :: #force_inline proc "c" (a: __m128i, $IMM8: u32) -> i32 { return i32(simd.extract(transmute(u16x8)a, IMM8)) } + +// Copy `a` to `dst`, and insert the 16-bit integer `i` into `dst` at the location specified by `imm8`. +// +// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_insert_epi16) @(require_results, enable_target_feature="sse2") -_mm_insert_epi16 :: #force_inline proc "c" (a: __m128i, i: i32, $IMM8: u32) -> __m128i { - return i32(simd.replace(transmute(u16x8)a, IMM8, i16(i))) +_mm_insert_epi16 :: #force_inline proc "c" (a: __m128i, i: i32, $IMM8: i32) -> __m128i where 0 <= IMM8, IMM8 < 8 { + return transmute(__m128i)simd.replace(transmute(simd.i16x8)a, uint(IMM8), i16(i)) } + @(require_results, enable_target_feature="sse2") _mm_movemask_epi8 :: #force_inline proc "c" (a: __m128i) -> i32 { return pmovmskb(transmute(i8x16)a) From a496d00f69259bfe02be06c3baca24c947c16eec Mon Sep 17 00:00:00 2001 From: bplu4t2f Date: Mon, 5 Oct 2026 10:41:27 +0200 Subject: [PATCH 13/17] Fix incorrect number of bytes written when formatting floats with `h`/`H` --- core/fmt/fmt.odin | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index a2e6d2247..385526a6b 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -1461,8 +1461,17 @@ fmt_float :: proc(fi: ^Info, v: f64, bit_size: int, verb: rune) { _fmt_float_as(fi, v, bit_size, verb, 'E', 6) case 'h', 'H': - prev_fi := fi^ - defer fi^ = prev_fi + prev_hash := fi.hash + defer fi.hash = prev_hash + prev_zero := fi.zero + defer fi.zero = prev_zero + prev_plus := fi.plus + defer fi.plus = prev_plus + prev_width := fi.width + defer fi.width = prev_width + prev_width_set := fi.width_set + defer fi.width_set = prev_width_set + fi.hash = false fi.zero = true fi.plus = false From e6d352495cc697c123de2bcf5aa9bb8472f1785d Mon Sep 17 00:00:00 2001 From: pJotoro <50463913+pJotoro@users.noreply.github.com> Date: Mon, 5 Oct 2026 11:28:11 +0200 Subject: [PATCH 14/17] Add GetCursor and GetDpiForSystem procedures --- core/sys/windows/user32.odin | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/sys/windows/user32.odin b/core/sys/windows/user32.odin index 75ed1e91b..5006c0671 100644 --- a/core/sys/windows/user32.odin +++ b/core/sys/windows/user32.odin @@ -205,6 +205,7 @@ foreign user32 { ClipCursor :: proc(lpRect: LPRECT) -> BOOL --- GetCursorPos :: proc(lpPoint: LPPOINT) -> BOOL --- SetCursorPos :: proc(X, Y: INT) -> BOOL --- + GetCursor :: proc() -> HCURSOR --- SetCursor :: proc(hCursor: HCURSOR) -> HCURSOR --- when !intrinsics.is_package_imported("raylib") { ShowCursor :: proc(bShow: BOOL) -> INT --- @@ -229,6 +230,7 @@ foreign user32 { GetThreadDpiAwarenessContext :: proc() -> DPI_AWARENESS_CONTEXT --- GetWindowDpiAwarenessContext :: proc(hwnd: HWND) -> DPI_AWARENESS_CONTEXT --- GetDpiFromDpiAwarenessContext :: proc(value: DPI_AWARENESS_CONTEXT) -> UINT --- + GetDpiForSystem :: proc() -> UINT --- GetDpiForWindow :: proc(hwnd: HWND) -> UINT --- SetProcessDpiAwarenessContext :: proc(value: DPI_AWARENESS_CONTEXT) -> BOOL --- From bd37cf8bddec935a7cc59c1043ebd6266539448f Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Mon, 5 Oct 2026 12:42:16 +0200 Subject: [PATCH 15/17] Upgrade Ubuntu CI to LLVM 22 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bfcce1bb..faf517e80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,8 +102,8 @@ jobs: run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 20 - echo "/usr/lib/llvm-20/bin" >> $GITHUB_PATH + sudo ./llvm.sh 22 + echo "/usr/lib/llvm-22/bin" >> $GITHUB_PATH - name: Build Odin run: ./build_odin.sh release - name: Odin version From b7e607737a565c09932636fa1be619123e075b0f Mon Sep 17 00:00:00 2001 From: A1029384756 Date: Mon, 5 Oct 2026 08:33:11 -0400 Subject: [PATCH 16/17] [windows-cross-compile] merge conflict --- src/linker.cpp | 72 +------------------------------------------------- 1 file changed, 1 insertion(+), 71 deletions(-) diff --git a/src/linker.cpp b/src/linker.cpp index a0d00993e..60716e726 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -499,7 +499,6 @@ try_cross_linking:; switch (build_context.linker_choice) { case Linker_lld: -<<<<<<< HEAD { #if defined(GB_SYSTEM_WINDOWS) char linker_path[4096] = {0}; @@ -515,7 +514,7 @@ try_cross_linking:; linker_path = "lld-link"; } #endif - result = system_exec_command_line_app("lld-link", + result = system_exec_msvc_linker_app("lld-link", "\"%s\" %s -OUT:\"%.*s\" %s " "/nologo /incremental:no /opt:ref /subsystem:%.*s " "%.*s " @@ -531,81 +530,12 @@ try_cross_linking:; lib_str, lld_lto_flags ); -======= - result = system_exec_msvc_linker_app("msvc-lld-link", - "\"%.*s\\bin\\lld-link\" %s %.*s -OUT:\"%.*s\" %s " - "/nologo /incremental:no /opt:ref /subsystem:%.*s " - "%.*s " - "%.*s " - "%s " - "%s " - "", - LIT(build_context.ODIN_ROOT), object_files, LIT(res_path), LIT(output_filename), - link_settings, - LIT(windows_subsystem_names[build_context.ODIN_WINDOWS_SUBSYSTEM]), - LIT(build_context.link_flags), - LIT(build_context.extra_linker_flags), - lib_str, - lld_lto_flags - ); ->>>>>>> upstream/master if (result) { return result; } break; } -<<<<<<< HEAD - case Linker_radlink: - result = system_exec_command_line_app("msvc-rad-link", - "\"%.*s\\bin\\radlink\" %s -OUT:\"%.*s\" %s " - "/nologo /incremental:no /opt:ref /subsystem:%.*s " - "%.*s " - "%.*s " - "%s " - "", - LIT(build_context.ODIN_ROOT), object_files, LIT(output_filename), - link_settings, - LIT(windows_subsystem_names[build_context.ODIN_WINDOWS_SUBSYSTEM]), - LIT(build_context.link_flags), - LIT(build_context.extra_linker_flags), - lib_str - ); - - if (result) { - return result; - } - break; - default: { // msvc - String res_path = quote_path(heap_allocator(), build_context.build_paths[BuildPath_RES]); - String rc_path = quote_path(heap_allocator(), build_context.build_paths[BuildPath_RC]); - defer (gb_free(heap_allocator(), res_path.text)); - defer (gb_free(heap_allocator(), rc_path.text)); - - if (build_context.has_resource) { - if (build_context.build_paths[BuildPath_RC].basename == "") { - debugf("Using precompiled resource %.*s\n", LIT(res_path)); - } else { - debugf("Compiling resource %.*s\n", LIT(res_path)); - - result = system_exec_command_line_app("msvc-link", - "\"%.*src.exe\" /nologo /fo %.*s %.*s", - LIT(windows_sdk_bin_path), - LIT(res_path), - LIT(rc_path) - ); - - if (result) { - return result; - } - } - } else { - res_path = {}; - } -======= - break; ->>>>>>> upstream/master - case Linker_msvc: { String linker_name = str_lit("link.exe"); switch (build_context.build_mode) { From 4fdb889c81cb8f74cf97252961caee779604aabc Mon Sep 17 00:00:00 2001 From: Rob Luppi Date: Mon, 5 Oct 2026 08:44:04 -0400 Subject: [PATCH 17/17] Fixing typo from userMateriald to userMaterialId I want to look at other issues, this is mostly a test of getting the process down with something easy --- vendor/box3d/box3d_types.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/box3d/box3d_types.odin b/vendor/box3d/box3d_types.odin index 84b8cb53f..9e1ca9116 100644 --- a/vendor/box3d/box3d_types.odin +++ b/vendor/box3d/box3d_types.odin @@ -104,7 +104,7 @@ OverlapResultFcn :: proc "c" (shapeId: ShapeId, ctx: rawptr) -> bool // @return -1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue // @see b3World_CastRay // @ingroup world -CastResultFcn :: proc "c" (shapeId: ShapeId, point: Pos, normal: Vec3, fraction: f32, userMateriald: u64, triangleIndex: c.int, childIndex: c.int, ctx: rawptr) -> f32 +CastResultFcn :: proc "c" (shapeId: ShapeId, point: Pos, normal: Vec3, fraction: f32, userMaterialId: u64, triangleIndex: c.int, childIndex: c.int, ctx: rawptr) -> f32 @(link_prefix="b3", default_calling_convention="c", require_results) foreign lib {