Skip to content

Commit feea6aa

Browse files
committed
PR feedback
1 parent 0192aa4 commit feea6aa

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

stdlib/public/runtime/EnvironmentVariables.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,14 @@ extern "C" char **_environ;
195195
// On Android, also try loading runtime debug env variables from system props.
196196
static void platformInitialize(void *context) {
197197
(void)context;
198-
#define SYSPROP_PREFIX "debug.swift.runtime."
199-
#define VARIABLE(name, type, defaultValue, help) \
200-
do { \
201-
char name##_string[PROP_VALUE_MAX] = ""; \
202-
if (__system_property_get(SYSPROP_PREFIX #name, name##_string) > 0) { \
203-
swift::runtime::environment::name##_isSet_variable = true; \
204-
swift::runtime::environment::name##_variable = \
205-
parse_##type(#name, name##_string, defaultValue); \
206-
} \
207-
} while (0);
198+
char propValueString[PROP_VALUE_MAX] = "";
199+
#define SYSPROP_PREFIX "debug.org.swift.runtime."
200+
#define VARIABLE(name, type, defaultValue, help) \
201+
if (__system_property_get(SYSPROP_PREFIX #name, propValueString)) { \
202+
swift::runtime::environment::name##_isSet_variable = true; \
203+
swift::runtime::environment::name##_variable = \
204+
parse_##type(#name, propValueString, defaultValue); \
205+
}
208206
#include "EnvironmentVariables.def"
209207
#undef VARIABLE
210208
}

0 commit comments

Comments
 (0)