Skip to content

Commit 85314f7

Browse files
Merge pull request #4882 from kateinoigakukun/pr-c7ef47460e4315ebd73ca77f70adcbe0d41252f7
2 parents 76b1357 + 68775d9 commit 85314f7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CoreFoundation/Base.subproj/CFPlatform.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include <mach-o/dyld.h>
2323
#endif
2424

25+
#if TARGET_OS_WASI
26+
#include <wasi/libc-environ.h>
27+
#endif
28+
2529
#define _CFEmitInternalDiagnostics 0
2630

2731

@@ -1813,8 +1817,10 @@ CF_EXPORT char **_CFEnviron(void) {
18131817
return *_NSGetEnviron();
18141818
#elif TARGET_OS_WIN32
18151819
return _environ;
1820+
#elif TARGET_OS_WASI
1821+
return __wasilibc_get_environ();
18161822
#else
1817-
#if TARGET_OS_BSD || TARGET_OS_WASI
1823+
#if TARGET_OS_BSD
18181824
extern char **environ;
18191825
#endif
18201826
return environ;

0 commit comments

Comments
 (0)