From fa3086811213c46cfb0256e88284bd0059001872 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Sun, 4 Feb 2024 16:20:24 +0000 Subject: [PATCH] [wasm] Fix signatures of `swift_retain` Function signature cannot be inconsistent in Wasm platforms. This patch fixes the signature of `swift_retain` to return the retained object. --- CoreFoundation/Base.subproj/CFPlatform.c | 2 +- CoreFoundation/Base.subproj/CFRuntime.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CoreFoundation/Base.subproj/CFPlatform.c b/CoreFoundation/Base.subproj/CFPlatform.c index 040e8966f2..a8e97f0c53 100644 --- a/CoreFoundation/Base.subproj/CFPlatform.c +++ b/CoreFoundation/Base.subproj/CFPlatform.c @@ -1625,7 +1625,7 @@ CF_PRIVATE int asprintf(char **ret, const char *format, ...) { #if DEPLOYMENT_RUNTIME_SWIFT #include -extern void swift_retain(void *); +extern void *swift_retain(void *); extern void swift_release(void *); #if TARGET_OS_WIN32 diff --git a/CoreFoundation/Base.subproj/CFRuntime.c b/CoreFoundation/Base.subproj/CFRuntime.c index afdbf5d21e..9f62ec3c9f 100644 --- a/CoreFoundation/Base.subproj/CFRuntime.c +++ b/CoreFoundation/Base.subproj/CFRuntime.c @@ -1407,7 +1407,7 @@ int DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID pReserved ) { #endif #if DEPLOYMENT_RUNTIME_SWIFT -extern void swift_retain(void *); +extern void *swift_retain(void *); #endif // For "tryR==true", a return of NULL means "failed".