Skip to content

Commit 3594917

Browse files
committed
setenv is not available in Windows build, replaced with _putenv_s
1 parent abbd7b2 commit 3594917

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/actions/set_env.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ bool SetENV::evaluate(RuleWithActions *rule, Transaction *t) {
3737
auto pair = utils::string::ssplit_pair(colNameExpanded, '=');
3838
ms_dbg_a(t, 8, "Setting environment variable: "
3939
+ pair.first + " to " + pair.second);
40+
#ifndef WIN32
4041
setenv(pair.first.c_str(), pair.second.c_str(), /*overwrite*/ 1);
42+
#else
43+
_putenv_s(pair.first.c_str(), pair.second.c_str());
44+
#endif
4145

4246
return true;
4347
}

0 commit comments

Comments
 (0)