Skip to content

Commit

Permalink
Handle setting environment on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicko authored and nakengelhardt committed Dec 6, 2024
1 parent 8b0f665 commit 1b403b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion passes/cmds/setenv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1b403b8

Please sign in to comment.