dtoolutil: Fix _MSC_VER macros that should be _WIN32

This commit is contained in:
Disyer 2023-02-26 11:50:41 +02:00
parent cd0eb27dc7
commit 108b317327

View File

@ -261,7 +261,7 @@ ns_has_environment_variable(const string &var) const {
#ifdef PREREAD_ENVIRONMENT
return false;
#elif defined(_MSC_VER)
#elif defined(_WIN32)
size_t size = 0;
getenv_s(&size, nullptr, 0, var.c_str());
return size != 0;
@ -305,7 +305,7 @@ ns_get_environment_variable(const string &var) const {
}
#ifndef PREREAD_ENVIRONMENT
#ifdef _MSC_VER
#ifdef _WIN32
std::string value(128, '\0');
size_t size = value.size();
while (getenv_s(&size, &value[0], size, var.c_str()) == ERANGE) {
@ -436,7 +436,7 @@ void ExecutionEnvironment::
ns_set_environment_variable(const string &var, const string &value) {
_variables[var] = value;
#ifdef _MSC_VER
#ifdef _WIN32
_putenv_s(var.c_str(), value.c_str());
#else
setenv(var.c_str(), value.c_str(), 1);
@ -464,7 +464,7 @@ ns_clear_shadow(const string &var) {
#ifdef PREREAD_ENVIRONMENT
// Now we have to replace the value in the table.
#ifdef _MSC_VER
#ifdef _WIN32
std::string value(128, '\0');
size_t size = value.size();
while (getenv_s(&size, &value[0], size, var.c_str()) == ERANGE) {