Skip to content

Commit

Permalink
[Support][test] Unconditionally use setenv macro when compiling on Wi…
Browse files Browse the repository at this point in the history
…ndows

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
  • Loading branch information
zero9178 committed Mar 9, 2021
1 parent c11ff4b commit 1956288
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/unittests/Support/ThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1956288

Please sign in to comment.