Skip to content

Commit 091d39e

Browse files
Cherry-pick 75669 to release/6.0 branch
4b3a197dc2eb0e1c83b847b250f448aa765ad4d5 was cherry-picked to release/6.0 branch, so we need to pick the follow-up fix too.
1 parent 6d75153 commit 091d39e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 650e90a2b06e3ad51371ec5a83b7b5d96a740572 Mon Sep 17 00:00:00 2001
2+
From: Yuta Saito <[email protected]>
3+
Date: Sat, 3 Aug 2024 07:25:16 +0000
4+
Subject: [PATCH 1/2] [Runtime] Repair build of `getenv` mode in
5+
`EnvironmentVariables.cpp`
6+
7+
Follow-up fix to 4b3a197dc2eb0e1c83b847b250f448aa765ad4d5
8+
---
9+
stdlib/public/runtime/EnvironmentVariables.cpp | 4 ++--
10+
1 file changed, 2 insertions(+), 2 deletions(-)
11+
12+
diff --git a/stdlib/public/runtime/EnvironmentVariables.cpp b/stdlib/public/runtime/EnvironmentVariables.cpp
13+
index 20491493e018b..ea5bfbd907e04 100644
14+
--- a/stdlib/public/runtime/EnvironmentVariables.cpp
15+
+++ b/stdlib/public/runtime/EnvironmentVariables.cpp
16+
@@ -247,11 +247,11 @@ void swift::runtime::environment::initialize(void *context) {
17+
// everywhere.
18+
#define VARIABLE(name, type, defaultValue, help) \
19+
do { \
20+
- const char name##_string = getenv(#name); \
21+
+ const char *name##_string = getenv(#name); \
22+
if (name##_string) \
23+
name##_isSet_variable = true; \
24+
name##_variable = parse_##type(#name, name##_string, defaultValue); \
25+
- } while (0)
26+
+ } while (0);
27+
#include "EnvironmentVariables.def"
28+
29+
// Print help if requested.
30+

0 commit comments

Comments
 (0)