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) {
173173// Initialization code.
174174swift::once_t swift::runtime::environment::initializeToken;
175175
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__)
177179extern " C" char **environ;
178180#define ENVIRON environ
179181#elif defined(_WIN32)
@@ -213,11 +215,11 @@ static void platformInitialize(void *context) {
213215}
214216#endif
215217
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)
221223void swift::runtime::environment::initialize (void *context) {
222224 // On platforms where we have an environment variable array available, scan it
223225 // directly. This optimizes for the common case where no variables are set,
@@ -295,6 +297,11 @@ void swift::runtime::environment::initialize(void *context) {
295297}
296298#endif
297299
300+ #else
301+ void swift::runtime::environment::initialize (void *context) {
302+ }
303+ #endif
304+
298305SWIFT_RUNTIME_EXPORT
299306bool swift_COWChecksEnabled () {
300307 return runtime::environment::SWIFT_DEBUG_ENABLE_COW_CHECKS ();
You can’t perform that action at this time.
0 commit comments