From: Benjamín García Roqués Date: Sun, 18 Feb 2024 15:23:53 +0000 (-0300) Subject: fixex: windows failing to compile with build.bat X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=7a958bea2db01fb5f1e3c2e20f5911e3ff6ae1e0;p=onyx.git fixex: windows failing to compile with build.bat --- 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);