[Support][test] Unconditionally use setenv macro when compiling on Windows

This test currently fails to compile when using a MinGW toolchain as setenv is not defined. This function is a POSIX function Windows does not implement.

This patch enables the setenv macro used in the unit test for all of Windows, making the test compile and run successfully.

Differential Revision: https://reviews.llvm.org/D98271
This commit is contained in:
Markus Böck 2021-03-09 19:52:24 +01:00
parent c11ff4bbad
commit 1956288fbb
1 changed files with 1 additions and 1 deletions

View File

@ -240,7 +240,7 @@ extern const char *TestMainArgv0;
// Just a reachable symbol to ease resolving of the executable's path.
static cl::opt<std::string> ThreadPoolTestStringArg1("thread-pool-string-arg1");
#ifdef _MSC_VER
#ifdef _WIN32
#define setenv(name, var, ignore) _putenv_s(name, var)
#endif