mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101703 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1a3eb953cc
commit
6523803203
@ -32,6 +32,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_POSIX_SPAWN
|
#ifdef HAVE_POSIX_SPAWN
|
||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
|
#if !defined(__APPLE__)
|
||||||
|
extern char **environ;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace llvm {
|
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;
|
pid_t PID;
|
||||||
int Err = posix_spawn(&PID, path.c_str(), &FileActions,
|
int Err = posix_spawn(&PID, path.c_str(), &FileActions,
|
||||||
/*attrp*/0, (char**)args, (char**)envp);
|
/*attrp*/0, (char**)args, (char**)envp);
|
||||||
|
Loading…
Reference in New Issue
Block a user