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 committed Nov 28, 2024
1 parent 34e02ad commit d678ec8
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 d678ec8

Please sign in to comment.