diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2010-04-18 07:07:48 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2010-04-18 07:07:48 +0000 |
commit | 554a39889b6d80e109dc33d1e4b7cb12e7caee4b (patch) | |
tree | 061635a818ded0023b047ca9f240c3e9cddef557 /llvm/lib/System | |
parent | 320aa4a493d4bacea34e66ea392611ca8dd3509d (diff) | |
download | bcm5719-llvm-554a39889b6d80e109dc33d1e4b7cb12e7caee4b.tar.gz bcm5719-llvm-554a39889b6d80e109dc33d1e4b7cb12e7caee4b.zip |
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.
llvm-svn: 101703
Diffstat (limited to 'llvm/lib/System')
-rw-r--r-- | llvm/lib/System/Unix/Program.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc index 2f3616e73a1..7fdf3872dd9 100644 --- a/llvm/lib/System/Unix/Program.inc +++ b/llvm/lib/System/Unix/Program.inc @@ -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 @@ Program::Execute(const Path &path, const char **args, const char **envp, } } +#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); |