From 7a958bea2db01fb5f1e3c2e20f5911e3ff6ae1e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benjam=C3=ADn=20Garc=C3=ADa=20Roqu=C3=A9s?= Date: Sun, 18 Feb 2024 12:23:53 -0300 Subject: [PATCH] fixex: windows failing to compile with build.bat --- build.bat | 11 +++++++++++ shared/include/bh.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/build.bat b/build.bat index fa8262a6..5244f69b 100644 --- a/build.bat +++ b/build.bat @@ -17,6 +17,12 @@ set FLAGS=%FLAGS% "/I%PWD%\shared\include" /DONYX_RUNTIME_LIBRARY=wasmer rc.exe misc/icon_resource.rc cl.exe %FLAGS% /Icompiler/include /std:c17 /TC %SOURCE_FILES% /link /IGNORE:4217 %LINK_OPTIONS% /DEBUG /OUT:onyx.exe /incremental:no /opt:ref /subsystem:console misc\icon_resource.res +REM Don't continue if we had compilation errors. This prevents CI to succeed. +if %ERRORLEVEL% neq 0 ( + echo Compiler compilation failed. + exit /b %ERRORLEVEL% +) + del *.pdb > NUL 2> NUL del *.ilk > NUL 2> NUL del *.obj > NUL 2> NUL @@ -24,6 +30,11 @@ del misc\icon_resource.res cl /MT /std:c17 /TC /I compiler/include /I shared/include /D_USRDLL /D_WINDLL runtime\onyx_runtime.c /link /DLL ws2_32.lib bcrypt.lib Synchronization.lib kernel32.lib /OUT:onyx_runtime.dll +if %ERRORLEVEL% neq 0 ( + echo Onyx runtime compilation failed. + exit /b %ERRORLEVEL% +) + del onyx_runtime.obj del onyx_runtime.lib del onyx_runtime.exp diff --git a/shared/include/bh.h b/shared/include/bh.h index 5004b9c6..4e561613 100644 --- a/shared/include/bh.h +++ b/shared/include/bh.h @@ -1926,6 +1926,10 @@ b32 bh_file_stat(char const* filename, bh_file_stats* out) { out->modified_time = timespec_to_ms(s.st_mtimespec); out->accessed_time = timespec_to_ms(s.st_atimespec); out->change_time = timespec_to_ms(s.st_ctimespec); +#elif defined(_BH_WINDOWS) + out->modified_time = s.st_mtime * 1000; + out->accessed_time = s.st_atime * 1000; + out->change_time = s.st_ctime * 1000; #else out->modified_time = timespec_to_ms(s.st_mtim); out->accessed_time = timespec_to_ms(s.st_atim); -- 2.25.1