[llvm] r227521 - iOS doesn't have crt_externs.h available, so we fall back to the posix method.

Chris Bieneman beanz at apple.com
Thu Jan 29 16:10:40 PST 2015


Author: cbieneman
Date: Thu Jan 29 18:10:39 2015
New Revision: 227521

URL: http://llvm.org/viewvc/llvm-project?rev=227521&view=rev
Log:
iOS doesn't have crt_externs.h available, so we fall back to the posix method.

Modified:
    llvm/trunk/lib/Support/Unix/Program.inc

Modified: llvm/trunk/lib/Support/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Program.inc?rev=227521&r1=227520&r2=227521&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Program.inc (original)
+++ llvm/trunk/lib/Support/Unix/Program.inc Thu Jan 29 18:10:39 2015
@@ -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, Str
     }
 
     if (!envp)
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) || defined(TARGET_OS_IPHONE)
       envp = const_cast<const char **>(environ);
 #else
       // environ is missing in dylibs.





More information about the llvm-commits mailing list