Handle setting environment on Windows

This commit is contained in:
Miodrag Milanovic 2024-11-28 14:39:49 +01:00
parent 34e02addc1
commit d678ec8f85
1 changed files with 5 additions and 1 deletions

View File

@ -41,8 +41,12 @@ struct SetenvPass : public Pass {
if(args.size() != 3)
log_cmd_error("Wrong number of arguments given.\n");
#if defined(_WIN32)
_putenv_s(args[1].c_str(), args[2].c_str());
#else
setenv(args[1].c_str(), args[2].c_str(), 1);
#endif
}
} SetenvPass;