[llvm] r180099 - Un-revert the environ copy in ProgramTest after fixing it on OS X

Reid Kleckner rnk at google.com
Tue Apr 23 14:06:12 PDT 2013


On Tue, Apr 23, 2013 at 4:43 PM, Charles Davis <cdavis5x at gmail.com> wrote:
>
> On Apr 23, 2013, at 7:15 AM, Reid Kleckner wrote:
>> Modified: llvm/trunk/unittests/Support/ProgramTest.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ProgramTest.cpp?rev=180099&r1=180098&r2=180099&view=diff
>> ==============================================================================
>> --- llvm/trunk/unittests/Support/ProgramTest.cpp (original)
>> +++ llvm/trunk/unittests/Support/ProgramTest.cpp Tue Apr 23 08:15:51 2013
>> @@ -24,6 +30,21 @@ ProgramTestStringArg1("program-test-stri
>> static cl::opt<std::string>
>> ProgramTestStringArg2("program-test-string-arg2");
>>
>> +static void CopyEnvironment(std::vector<const char *> &out) {
>> +#ifdef __APPLE__
>> +  // _NSGetEnviron() only works from the main exe on Mac.  Fortunately the test
>> +  // should be in the executable.
> No, no, no, I said that the *environ global* only works from the main exe. _NSGetEnviron() was specifically designed to be safe to call from a dylib. Sorry if I wasn't clear about that earlier.

In other words, all I have to do is forward declare environ and it
would've worked?



More information about the llvm-commits mailing list