diff --git a/CoreFoundation/Base.subproj/CFPlatform.c b/CoreFoundation/Base.subproj/CFPlatform.c index 040e8966f2..672a437526 100644 --- a/CoreFoundation/Base.subproj/CFPlatform.c +++ b/CoreFoundation/Base.subproj/CFPlatform.c @@ -22,6 +22,10 @@ #include #endif +#if TARGET_OS_WASI +#include +#endif + #define _CFEmitInternalDiagnostics 0 @@ -1812,8 +1816,10 @@ CF_EXPORT char **_CFEnviron(void) { return *_NSGetEnviron(); #elif TARGET_OS_WIN32 return _environ; +#elif TARGET_OS_WASI + return __wasilibc_get_environ(); #else -#if TARGET_OS_BSD || TARGET_OS_WASI +#if TARGET_OS_BSD extern char **environ; #endif return environ;