Skip to content

Commit 916e4bc

Browse files
[wasm] Stop using __builtin_return_address on WASI
Othwerwise we get: `error: Non-Emscripten WebAssembly hasn't implemented __builtin_return_address` when building without optimizations.
1 parent d51beea commit 916e4bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: Sources/CoreFoundation/CFBundle.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,13 @@ static CFBundleRef _CFBundleGetBundleWithIdentifier(CFStringRef bundleID, void *
596596

597597
CFBundleRef CFBundleGetBundleWithIdentifier(CFStringRef bundleID) {
598598
// Use the frame that called this as a hint
599-
return _CFBundleGetBundleWithIdentifier(bundleID, __builtin_return_address(0));
599+
void *hint;
600+
#if TARGET_OS_WASI
601+
hint = NULL;
602+
#else
603+
hint = __builtin_return_address(0);
604+
#endif
605+
return _CFBundleGetBundleWithIdentifier(bundleID, hint);
600606
}
601607

602608
CFBundleRef _CFBundleGetBundleWithIdentifierWithHint(CFStringRef bundleID, void *pointer) {

0 commit comments

Comments
 (0)