Skip to content

Commit d0e7398

Browse files
authored
Merge pull request #42110 from al45tair/eng/PR-91050064
[Concurrency] Don't use getenv() unless SWIFT_STDLIB_HAS_ENVIRON is set.
2 parents afed427 + 3251df8 commit d0e7398

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/Concurrency/Actor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,15 @@ static bool swift_task_isCurrentExecutorImpl(ExecutorRef executor) {
332332
static unsigned unexpectedExecutorLogLevel = 1;
333333

334334
static void checkUnexpectedExecutorLogLevel(void *context) {
335+
#if SWIFT_STDLIB_HAS_ENVIRON
335336
const char *levelStr = getenv("SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL");
336337
if (!levelStr)
337338
return;
338339

339340
long level = strtol(levelStr, nullptr, 0);
340341
if (level >= 0 && level < 3)
341342
unexpectedExecutorLogLevel = level;
343+
#endif // SWIFT_STDLIB_HAS_ENVIRON
342344
}
343345

344346
SWIFT_CC(swift)

0 commit comments

Comments
 (0)