[llvm-commits] [llvm] r101703 - /llvm/trunk/lib/System/Unix/Program.inc

Nick Lewycky nicholas at mxc.ca
Sun Apr 18 00:07:48 PDT 2010


Author: nicholas
Date: Sun Apr 18 02:07:48 2010
New Revision: 101703

URL: http://llvm.org/viewvc/llvm-project?rev=101703&view=rev
Log:
This is horrible. Split the difference, and declare 'environ' on all non-Darwin
platforms to unbreak the darwin and linux builds. The BSD folks should feel
free to change the #if, if this breaks them.

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

Modified: llvm/trunk/lib/System/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=101703&r1=101702&r2=101703&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Program.inc (original)
+++ llvm/trunk/lib/System/Unix/Program.inc Sun Apr 18 02:07:48 2010
@@ -32,6 +32,9 @@
 #endif
 #ifdef HAVE_POSIX_SPAWN
 #include <spawn.h>
+#if !defined(__APPLE__)
+  extern char **environ;
+#endif
 #endif
 
 namespace llvm {
@@ -199,6 +202,10 @@
       }
     }
 
+#if !defined(__APPLE__)
+    if (!envp) envp = (const char**)environ;
+#endif
+
     pid_t PID;
     int Err = posix_spawn(&PID, path.c_str(), &FileActions,
                           /*attrp*/0, (char**)args, (char**)envp);





More information about the llvm-commits mailing list