From 39687b93fa5bd0eec8d39c3223a2b71da6341793 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Fri, 30 Jan 2015 00:10:39 +0000 Subject: [PATCH] iOS doesn't have crt_externs.h available, so we fall back to the posix method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227521 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Program.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Support/Unix/Program.inc b/lib/Support/Unix/Program.inc index 0f45df1a0da..2ed5597e4ad 100644 --- a/lib/Support/Unix/Program.inc +++ b/lib/Support/Unix/Program.inc @@ -42,7 +42,10 @@ #define _RESTRICT_KYWD #endif #include -#if !defined(__APPLE__) +#if defined(__APPLE__) +#include +#endif +#if !defined(__APPLE__) || defined(TARGET_OS_IPHONE) extern char **environ; #else #include // _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(environ); #else // environ is missing in dylibs.