diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-04-24 17:50:30 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-04-24 17:50:30 +0000 |
commit | 268adf2a03cf352593b632c5249c83f4fc56956f (patch) | |
tree | 76069353db8a3498b92c9750725576ae13734e80 | |
parent | 84875bad9c32b1110c6b8abd4f1346cc0dca761b (diff) | |
download | external_llvm-268adf2a03cf352593b632c5249c83f4fc56956f.zip external_llvm-268adf2a03cf352593b632c5249c83f4fc56956f.tar.gz external_llvm-268adf2a03cf352593b632c5249c83f4fc56956f.tar.bz2 |
Don't forward declare environ on Windows
That seems to interact poorly with the environ and _environ macros
defined in MSVC's <stdlib.h>.
Also remove the incorrect comment about _NSGetEnviron().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180200 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-x | unittests/Support/ProgramTest.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/unittests/Support/ProgramTest.cpp b/unittests/Support/ProgramTest.cpp index 80b0334..279e2e8 100755 --- a/unittests/Support/ProgramTest.cpp +++ b/unittests/Support/ProgramTest.cpp @@ -13,9 +13,9 @@ #include "gtest/gtest.h" #include <stdlib.h> -#ifdef __APPLE__ +#if defined(__APPLE__) # include <crt_externs.h> -#else +#elif !defined(_MSC_VER) // Forward declare environ in case it's not provided by stdlib.h. extern char **environ; #endif @@ -32,8 +32,6 @@ 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. char **envp = *_NSGetEnviron(); #else // environ seems to work for Windows and most other Unices. |