Browse Source

dtoolutil: Fix _MSC_VER macros that should be _WIN32

Disyer 2 years ago
parent
commit
108b317327
1 changed files with 4 additions and 4 deletions
  1. 4 4
      dtool/src/dtoolutil/executionEnvironment.cxx

+ 4 - 4
dtool/src/dtoolutil/executionEnvironment.cxx

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