File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,9 @@ void printHelp(const char *extra) {
173
173
// Initialization code.
174
174
swift::once_t swift::runtime::environment::initializeToken;
175
175
176
- #if SWIFT_STDLIB_HAS_ENVIRON && (defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__linux__))
176
+ #if SWIFT_STDLIB_HAS_ENVIRON
177
+
178
+ #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__linux__)
177
179
extern " C" char **environ;
178
180
#define ENVIRON environ
179
181
#elif defined(_WIN32)
@@ -213,11 +215,11 @@ static void platformInitialize(void *context) {
213
215
}
214
216
#endif
215
217
216
- #if !SWIFT_STDLIB_HAS_ENVIRON
217
- void swift::runtime::environment::initialize ( void *context) {
218
- platformInitialize (context);
219
- }
220
- #elif defined(ENVIRON)
218
+ #endif
219
+
220
+ # if SWIFT_STDLIB_HAS_ENVIRON
221
+
222
+ #if defined(ENVIRON)
221
223
void swift::runtime::environment::initialize (void *context) {
222
224
// On platforms where we have an environment variable array available, scan it
223
225
// directly. This optimizes for the common case where no variables are set,
@@ -295,6 +297,11 @@ void swift::runtime::environment::initialize(void *context) {
295
297
}
296
298
#endif
297
299
300
+ #else
301
+ void swift::runtime::environment::initialize (void *context) {
302
+ }
303
+ #endif
304
+
298
305
SWIFT_RUNTIME_EXPORT
299
306
bool swift_COWChecksEnabled () {
300
307
return runtime::environment::SWIFT_DEBUG_ENABLE_COW_CHECKS ();
You can’t perform that action at this time.
0 commit comments