Skip to content

Commit 3a3241b

Browse files
authored
Add #if TARGET_OS_WASI to _CFReallocf definition (swiftlang#3026)
This allows `_CFReallocf` function to be built for Wasm/WASI.
1 parent 8878bf3 commit 3a3241b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CoreFoundation/Base.subproj/CFPlatform.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,7 @@ int _CFOpenFile(const char *path, int opts) {
17111711
}
17121712

17131713
CF_CROSS_PLATFORM_EXPORT void *_CFReallocf(void *ptr, size_t size) {
1714-
#if TARGET_OS_WIN32 || TARGET_OS_LINUX || defined(__OpenBSD__)
1714+
#if TARGET_OS_WIN32 || TARGET_OS_LINUX || TARGET_OS_WASI || defined(__OpenBSD__)
17151715
void *mem = realloc(ptr, size);
17161716
if (mem == NULL && ptr != NULL && size != 0) {
17171717
free(ptr);

0 commit comments

Comments
 (0)