From c89ff650ee9239604f542cef8298e62eb5fb1b69 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Sat, 7 Aug 2021 13:31:21 +0100 Subject: [PATCH] Add #if TARGET_OS_WASI to _CFReallocf definition This allows this function to built for Wasm/WASI. --- CoreFoundation/Base.subproj/CFPlatform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CoreFoundation/Base.subproj/CFPlatform.c b/CoreFoundation/Base.subproj/CFPlatform.c index bf332973eb..033f438436 100644 --- a/CoreFoundation/Base.subproj/CFPlatform.c +++ b/CoreFoundation/Base.subproj/CFPlatform.c @@ -1711,7 +1711,7 @@ int _CFOpenFile(const char *path, int opts) { } CF_CROSS_PLATFORM_EXPORT void *_CFReallocf(void *ptr, size_t size) { -#if TARGET_OS_WIN32 || TARGET_OS_LINUX || defined(__OpenBSD__) +#if TARGET_OS_WIN32 || TARGET_OS_LINUX || TARGET_OS_WASI || defined(__OpenBSD__) void *mem = realloc(ptr, size); if (mem == NULL && ptr != NULL && size != 0) { free(ptr);