From da04af1cbfc61d51a6a7d885fb84c54297ed553f Mon Sep 17 00:00:00 2001 From: udo Date: Fri, 17 Jul 2026 14:52:34 +0000 Subject: [PATCH] Export math functions to Wasm components --- site/tests/cli_runner.uce | 1 + src/wasm/core.cpp | 4 ++++ src/wasm/core_libc_exports.syms | 3 +++ 3 files changed, 8 insertions(+) diff --git a/site/tests/cli_runner.uce b/site/tests/cli_runner.uce index b2321b5..2c03fe6 100644 --- a/site/tests/cli_runner.uce +++ b/site/tests/cli_runner.uce @@ -149,6 +149,7 @@ StringList cli_demo_error_markers() markers.push_back(String("uce compile ") + "error"); markers.push_back(String("fatal signal during ") + "request"); markers.push_back(String("uncaught exception during ") + "request"); + markers.push_back("component not found"); return(markers); } diff --git a/src/wasm/core.cpp b/src/wasm/core.cpp index ce37190..e4299b1 100644 --- a/src/wasm/core.cpp +++ b/src/wasm/core.cpp @@ -450,6 +450,10 @@ extern "C" void uce_wasm_link_anchors() (void*)&isdigit, (void*)&isgraph, (void*)&islower, (void*)&isprint, (void*)&ispunct, (void*)&isspace, (void*)&isupper, (void*)&isxdigit, (void*)&tolower, (void*)&toupper, + // math functions used by side modules but not otherwise retained by core + (void*)(double (*)(double))&cos, + (void*)(double (*)(double))&sin, + (void*)(double (*)(double))&round, }; (void)libc_anchors; } diff --git a/src/wasm/core_libc_exports.syms b/src/wasm/core_libc_exports.syms index 232046e..66eb973 100644 --- a/src/wasm/core_libc_exports.syms +++ b/src/wasm/core_libc_exports.syms @@ -33,3 +33,6 @@ isupper isxdigit tolower toupper +cos +sin +round