Skip to content

Embedded: Swift SDK now passes the -Xcc -D__EMBEDDED_SWIFT__ #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Sources/_CJavaScriptKit/_CJavaScriptKit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down