Преглед изворни кода

Source: Fix typo in _WIN32 preprocessor checks

Since CMake's default compiler flags with MSVC include `-DWIN32` for
historical reasons, a few preprocessor conditions were accidentally
checking for `WIN32` instead of `_WIN32`.  The corresponding blocks
were left out when compiling official binaries for `cmake.org` because
we hard-code compiler flags without `-DWIN32`.

Fixes: #22764
Brad King пре 4 година
родитељ
комит
40e73c5ac4
4 измењених фајлова са 4 додато и 4 уклоњено
  1. 1 1
      Source/CPack/cmCPackDebGenerator.cxx
  2. 1 1
      Source/cmFileCopier.cxx
  3. 1 1
      Source/cmLocalNinjaGenerator.cxx
  4. 1 1
      Source/cmcmd.cxx

+ 1 - 1
Source/CPack/cmCPackDebGenerator.cxx

@@ -211,7 +211,7 @@ bool DebGenerator::generateDataTar() const
     cmCPackLogger(cmCPackLog::LOG_DEBUG,
     cmCPackLogger(cmCPackLog::LOG_DEBUG,
                   "RELATIVEDIR: \"" << relativeDir << "\"" << std::endl);
                   "RELATIVEDIR: \"" << relativeDir << "\"" << std::endl);
 
 
-#ifdef WIN32
+#ifdef _WIN32
     std::string mode_t_adt_filename = file + ":cmake_mode_t";
     std::string mode_t_adt_filename = file + ":cmake_mode_t";
     cmsys::ifstream permissionStream(mode_t_adt_filename.c_str());
     cmsys::ifstream permissionStream(mode_t_adt_filename.c_str());
 
 

+ 1 - 1
Source/cmFileCopier.cxx

@@ -72,7 +72,7 @@ bool cmFileCopier::SetPermissions(const std::string& toFile,
                                   mode_t permissions)
                                   mode_t permissions)
 {
 {
   if (permissions) {
   if (permissions) {
-#ifdef WIN32
+#ifdef _WIN32
     if (Makefile->IsOn("CMAKE_CROSSCOMPILING")) {
     if (Makefile->IsOn("CMAKE_CROSSCOMPILING")) {
       // Store the mode in an NTFS alternate stream.
       // Store the mode in an NTFS alternate stream.
       std::string mode_t_adt_filename = toFile + ":cmake_mode_t";
       std::string mode_t_adt_filename = toFile + ":cmake_mode_t";

+ 1 - 1
Source/cmLocalNinjaGenerator.cxx

@@ -85,7 +85,7 @@ void cmLocalNinjaGenerator::Generate()
       cmGlobalNinjaGenerator::WriteComment(this->GetRulesFileStream(),
       cmGlobalNinjaGenerator::WriteComment(this->GetRulesFileStream(),
                                            "localized /showIncludes string");
                                            "localized /showIncludes string");
       this->GetRulesFileStream() << "msvc_deps_prefix = ";
       this->GetRulesFileStream() << "msvc_deps_prefix = ";
-#ifdef WIN32
+#ifdef _WIN32
       // Ninja uses the ANSI Windows APIs, so strings in the rules file
       // Ninja uses the ANSI Windows APIs, so strings in the rules file
       // typically need to be ANSI encoded. However, in this case the compiler
       // typically need to be ANSI encoded. However, in this case the compiler
       // is being invoked using the UTF-8 codepage so the /showIncludes prefix
       // is being invoked using the UTF-8 codepage so the /showIncludes prefix

+ 1 - 1
Source/cmcmd.cxx

@@ -1334,7 +1334,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
           cmSystemTools::Error("Problem extracting tar: " + outFile);
           cmSystemTools::Error("Problem extracting tar: " + outFile);
           return 1;
           return 1;
         }
         }
-#ifdef WIN32
+#ifdef _WIN32
         // OK, on windows 7 after we untar some files,
         // OK, on windows 7 after we untar some files,
         // sometimes we can not rename the directory after
         // sometimes we can not rename the directory after
         // the untar is done. This breaks the external project
         // the untar is done. This breaks the external project