Skip to content

Commit

Permalink
if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Feb 26, 2024
1 parent 5d5cf87 commit 73998a2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/cpp/multisolver_interface/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,17 @@ std::string GetXpressVarFromEnvironmentVariables(const char* XPRESS_var,
size_t requiredSize;

getenv_s(&requiredSize, NULL, 0, XPRESS_var);
if (requiredSize == 0 && verbose) {
std::cout << "[Windows getenv_s function]: " << XPRESS_var
<< " doesn't exist!\n";
} else {
if (requiredSize != 0) {
xpress_home_from_env.resize(requiredSize);

// Get the value of the LIB environment variable.
getenv_s(&requiredSize, xpress_home_from_env.data(), requiredSize,
XPRESS_var);
} else {
if (verbose) {
std::cout << "[Windows getenv_s function]: " << XPRESS_var
<< " doesn't exist!\n";
}
}
#else
char* path = nullptr;
Expand Down

0 comments on commit 73998a2

Please sign in to comment.