From 2cebc558eb314e324f01ef05735551f234f5ea13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sun, 27 Oct 2024 23:28:39 -0700 Subject: [PATCH] Cleanup. --- scripts/genie.lua | 9 +++++++++ src/os.cpp | 9 ++++----- tests/filepath_test.cpp | 5 +++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index e20e0d6..619200c 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -87,6 +87,15 @@ project "bx.test" "Cocoa.framework", } + configuration { "wasm" } + buildoptions { + "-fwasm-exceptions", + } + linkoptions { + "-fwasm-exceptions", + "-s STACK_SIZE=262144", + } + configuration {} strip() diff --git a/src/os.cpp b/src/os.cpp index c517bf2..659f589 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -50,8 +50,6 @@ # include # elif BX_PLATFORM_OSX # include // mach_task_basic_info -# elif BX_PLATFORM_ANDROID -# include "debug.h" // getTid is not implemented... # endif // BX_PLATFORM_ANDROID #endif // BX_PLATFORM_ @@ -65,7 +63,7 @@ namespace bx || BX_PLATFORM_WINRT \ || BX_CRT_NONE BX_UNUSED(_ms); - debugOutput("sleep is not implemented"); debugBreak(); + BX_ASSERT(false, "Function '%s' is not implemented!", BX_FUNCTION); #else timespec req = { (time_t)_ms/1000, (long)( (_ms%1000)*1000000) }; timespec rem = { 0, 0 }; @@ -80,7 +78,7 @@ namespace bx #elif BX_PLATFORM_XBOXONE \ || BX_PLATFORM_WINRT \ || BX_CRT_NONE - debugOutput("yield is not implemented"); debugBreak(); + BX_ASSERT(false, "Function '%s' is not implemented!", BX_FUNCTION); #else ::sched_yield(); #endif // BX_PLATFORM_ @@ -97,7 +95,7 @@ namespace bx || BX_PLATFORM_OSX return (mach_port_t)::pthread_mach_thread_np(pthread_self() ); #else - debugOutput("getTid is not implemented"); debugBreak(); + BX_ASSERT(false, "Function '%s' is not implemented!", BX_FUNCTION); return 0; #endif // BX_PLATFORM_ } @@ -155,6 +153,7 @@ namespace bx ); return pmc.WorkingSetSize; #else + BX_ASSERT(false, "Function '%s' is not implemented!", BX_FUNCTION); return 0; #endif // BX_PLATFORM_* } diff --git a/tests/filepath_test.cpp b/tests/filepath_test.cpp index 7d5e1af..218e44a 100644 --- a/tests/filepath_test.cpp +++ b/tests/filepath_test.cpp @@ -130,6 +130,11 @@ TEST_CASE("FilePath temp", "[filepath]") tmp.join("bx.test/abvgd/555333/test"); REQUIRE(bx::makeAll(tmp, bx::ErrorAssert{}) ); + if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN) ) + { + SKIP("Not supported by wasm."); + } + tmp.set(bx::Dir::Temp); tmp.join("bx.test"); REQUIRE(bx::removeAll(tmp, bx::ErrorAssert{}) );