From a2c2963f1e730be63398f24b7d1ac52ddf6cce17 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Thu, 12 Jun 2025 08:09:18 +0000 Subject: [PATCH] Embedded: Swift SDK now passes the `-Xcc -D__EMBEDDED_SWIFT__` --- Sources/_CJavaScriptKit/_CJavaScriptKit.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/_CJavaScriptKit/_CJavaScriptKit.c b/Sources/_CJavaScriptKit/_CJavaScriptKit.c index a3288180..87e814e0 100644 --- a/Sources/_CJavaScriptKit/_CJavaScriptKit.c +++ b/Sources/_CJavaScriptKit/_CJavaScriptKit.c @@ -31,10 +31,7 @@ void swjs_cleanup_host_function_call(void *argv_buffer) { free(argv_buffer); } -// NOTE: This __wasi__ check is a hack for Embedded compatibility (assuming that if __wasi__ is defined, we are not building for Embedded) -// cdecls don't work in Embedded, but @_expose(wasm) can be used with Swift >=6.0 -// the previously used `#if __Embedded` did not play well with SwiftPM (defines needed to be on every target up the chain) -# ifdef __wasi__ +# if defined(__wasi__) && !defined(__EMBEDDED_SWIFT__) bool _call_host_function_impl(const JavaScriptHostFuncRef host_func_ref, const RawJSValue *argv, const int argc, const JavaScriptObjectRef callback_func);