summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-03-24 21:58:25 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-03-24 21:58:25 (GMT)
commite9fc7ff5052f3ab40c2b39ba653506c5346d4582 (patch)
tree7f659b0634c32c40ba4dc1de459dbe4ced0484ad
parent3142808f15b0dabca8a5d66535c3f795ed470bac (diff)
downloadCMake-e9fc7ff5052f3ab40c2b39ba653506c5346d4582.zip
CMake-e9fc7ff5052f3ab40c2b39ba653506c5346d4582.tar.gz
CMake-e9fc7ff5052f3ab40c2b39ba653506c5346d4582.tar.bz2
Add self-sufficient wrapper for <sys/stat.h>
-rw-r--r--Source/CPack/WiX/cmWIXFilesSourceWriter.cxx4
-rw-r--r--Source/CPack/cmCPackCygwinSourceGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx2
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx5
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx2
-rw-r--r--Source/QtDialog/CMakeSetup.cxx2
-rw-r--r--Source/cmFileCommand.cxx5
-rw-r--r--Source/cmFileTimeComparison.cxx2
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.h7
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx2
-rw-r--r--Source/cmSystemTools.cxx2
-rw-r--r--Source/cmSystemTools.h6
-rw-r--r--Source/cmWriteFileCommand.cxx5
-rw-r--r--Source/cm_sys_stat.h14
-rw-r--r--Source/cmake.cxx5
17 files changed, 29 insertions, 39 deletions
diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
index a471d26..3158343 100644
--- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
@@ -9,9 +9,7 @@
#include <cmSystemTools.h>
#include <cmUuid.h>
-#include <sys/types.h>
-// include sys/stat.h after sys/types.h
-#include <sys/stat.h>
+#include "cm_sys_stat.h"
cmWIXFilesSourceWriter::cmWIXFilesSourceWriter(cmCPackLog* logger,
std::string const& filename,
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
index 92475d9..bd22cec 100644
--- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
@@ -15,7 +15,7 @@
// system tools because it is not implemented robustly enough to move
// files across directories.
#ifdef _WIN32
-#include <sys/stat.h>
+#include "cm_sys_stat.h"
#include <windows.h>
#endif
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 5c50da8..ed87238 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -8,6 +8,7 @@
#include "cmCPackLog.h"
#include "cmGeneratedFileStream.h"
#include "cmSystemTools.h"
+#include "cm_sys_stat.h"
#include <cmsys/Glob.hxx>
#include <limits.h>
@@ -16,7 +17,6 @@
#include <set>
#include <stdio.h>
#include <string.h>
-#include <sys/stat.h>
#include <utility>
// NOTE:
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 0d8dc48..8ea88a8 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -3,12 +3,12 @@
#include "cmCPackOSXX11Generator.h"
#include <sstream>
-#include <sys/stat.h>
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmGeneratedFileStream.h"
#include "cmSystemTools.h"
+#include "cm_sys_stat.h"
cmCPackOSXX11Generator::cmCPackOSXX11Generator()
{
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index 682394e..2765e2a 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -8,13 +8,10 @@
#include <string>
#include <vector>
-#include <sys/types.h>
-// include sys/stat.h after sys/types.h
-#include <sys/stat.h>
-
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmSystemTools.h"
+#include "cm_sys_stat.h"
cmCPackSTGZGenerator::cmCPackSTGZGenerator()
{
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index cc399b0..88193b0 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -25,8 +25,8 @@
#if defined(CTEST_USE_XMLRPC)
#include "cmVersion.h"
+#include "cm_sys_stat.h"
#include <cm_xmlrpc.h>
-#include <sys/stat.h>
#endif
#define SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT 120
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 5e03c39..b2f0b2d 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -184,9 +184,9 @@ int main(int argc, char** argv)
}
#if defined(Q_OS_MAC)
+#include "cm_sys_stat.h"
#include <errno.h>
#include <string.h>
-#include <sys/stat.h>
#include <unistd.h>
static bool cmOSXInstall(std::string const& dir, std::string const& tool)
{
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 957b4cb..97292f9 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -16,10 +16,6 @@
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
-// include sys/stat.h after sys/types.h
-#include <sys/stat.h>
-
#include "cmAlgorithms.h"
#include "cmCommandArgumentsHelper.h"
#include "cmCryptoHash.h"
@@ -35,6 +31,7 @@
#include "cmSystemTools.h"
#include "cmTimestamp.h"
#include "cm_auto_ptr.hxx"
+#include "cm_sys_stat.h"
#include "cmake.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index 991ebb8..ef4337b 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -10,7 +10,7 @@
// Use a platform-specific API to get file times efficiently.
#if !defined(_WIN32) || defined(__CYGWIN__)
-#include <sys/stat.h>
+#include "cm_sys_stat.h"
#define cmFileTimeComparison_Type struct stat
#else
#include <cmsys/Encoding.hxx>
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h
index 26135df..1223ffd 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -11,12 +11,7 @@
#include "cmGeneratorExpression.h"
#include "cm_auto_ptr.hxx"
-
-#if defined(_MSC_VER)
-typedef unsigned short mode_t;
-#else
-#include <sys/types.h>
-#endif
+#include "cm_sys_stat.h"
class cmLocalGenerator;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index c4a488f..f7d822a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -38,6 +38,7 @@
#include "cmVersion.h"
#include "cmWorkingDirectory.h"
#include "cm_auto_ptr.hxx"
+#include "cm_sys_stat.h"
#include "cmake.h"
#ifdef CMAKE_BUILD_WITH_CMAKE
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index ead3dfc..d69794c 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -15,6 +15,7 @@
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
+#include "cm_sys_stat.h"
#include "cmake.h"
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -27,7 +28,6 @@
#include <map>
#include <set>
#include <string>
-#include <sys/stat.h>
#include <utility>
#include <vector>
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index b2e3c6a..ee751f2 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -4,6 +4,7 @@
#include "cmAlgorithms.h"
#include "cmProcessOutput.h"
+#include "cm_sys_stat.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
#include "cmArchiveWrite.h"
@@ -42,7 +43,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/stat.h>
#include <time.h>
#include <utility>
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 070f81f..e93eaae 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -12,12 +12,6 @@
#include <string>
#include <vector>
-#if defined(_MSC_VER)
-typedef unsigned short mode_t;
-#else
-#include <sys/types.h>
-#endif
-
class cmSystemToolsFileTime;
/** \class cmSystemTools
diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx
index 96c8e27..ce2de57 100644
--- a/Source/cmWriteFileCommand.cxx
+++ b/Source/cmWriteFileCommand.cxx
@@ -4,12 +4,9 @@
#include <cmsys/FStream.hxx>
-#include <sys/types.h>
-// include sys/stat.h after sys/types.h
-#include <sys/stat.h>
-
#include "cmMakefile.h"
#include "cmSystemTools.h"
+#include "cm_sys_stat.h"
class cmExecutionStatus;
diff --git a/Source/cm_sys_stat.h b/Source/cm_sys_stat.h
new file mode 100644
index 0000000..26e4baa
--- /dev/null
+++ b/Source/cm_sys_stat.h
@@ -0,0 +1,14 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cm_sys_stat_h
+#define cm_sys_stat_h
+
+#if defined(_MSC_VER)
+typedef unsigned short mode_t;
+#endif
+
+#include <sys/types.h>
+// include sys/stat.h after sys/types.h
+#include <sys/stat.h>
+
+#endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 3af3be6..4363c12 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -25,6 +25,7 @@
#include "cmVersionConfig.h"
#include "cmWorkingDirectory.h"
#include "cm_auto_ptr.hxx"
+#include "cm_sys_stat.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
#include <cm_jsoncpp_writer.h>
@@ -106,10 +107,6 @@
#include <sys/time.h>
#endif
-#include <sys/types.h>
-// include sys/stat.h after sys/types.h
-#include <sys/stat.h> // struct stat
-
#include <algorithm>
#include <cmsys/FStream.hxx>
#include <cmsys/Glob.hxx>