summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/Program.inc
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-01-30 00:10:39 +0000
committerChris Bieneman <beanz@apple.com>2015-01-30 00:10:39 +0000
commit7b7d2779d12287b2478f26b6de0a584e96d59ca9 (patch)
tree846804f2020dc891b3414911d841da4a7c2543df /llvm/lib/Support/Unix/Program.inc
parente83ab8c2deb42ba56ea6cbf7209c319b47723c7a (diff)
downloadbcm5719-llvm-7b7d2779d12287b2478f26b6de0a584e96d59ca9.tar.gz
bcm5719-llvm-7b7d2779d12287b2478f26b6de0a584e96d59ca9.zip
iOS doesn't have crt_externs.h available, so we fall back to the posix method.
llvm-svn: 227521
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
-rw-r--r--llvm/lib/Support/Unix/Program.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc
index 0f45df1a0da..2ed5597e4ad 100644
--- a/llvm/lib/Support/Unix/Program.inc
+++ b/llvm/lib/Support/Unix/Program.inc
@@ -42,7 +42,10 @@
#define _RESTRICT_KYWD
#endif
#include <spawn.h>
-#if !defined(__APPLE__)
+#if defined(__APPLE__)
+#include <TargetConditionals.h>
+#endif
+#if !defined(__APPLE__) || defined(TARGET_OS_IPHONE)
extern char **environ;
#else
#include <crt_externs.h> // _NSGetEnviron
@@ -217,7 +220,7 @@ static bool Execute(ProcessInfo &PI, StringRef Program, const char **args,
}
if (!envp)
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) || defined(TARGET_OS_IPHONE)
envp = const_cast<const char **>(environ);
#else
// environ is missing in dylibs.
OpenPOWER on IntegriCloud