From e9fc7ff5052f3ab40c2b39ba653506c5346d4582 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Fri, 24 Mar 2017 22:58:25 +0100 Subject: Add self-sufficient wrapper for --- Source/CPack/WiX/cmWIXFilesSourceWriter.cxx | 4 +--- Source/CPack/cmCPackCygwinSourceGenerator.cxx | 2 +- Source/CPack/cmCPackDebGenerator.cxx | 2 +- Source/CPack/cmCPackOSXX11Generator.cxx | 2 +- Source/CPack/cmCPackSTGZGenerator.cxx | 5 +---- Source/CTest/cmCTestSubmitHandler.cxx | 2 +- Source/QtDialog/CMakeSetup.cxx | 2 +- Source/cmFileCommand.cxx | 5 +---- Source/cmFileTimeComparison.cxx | 2 +- Source/cmGeneratorExpressionEvaluationFile.h | 7 +------ Source/cmMakefile.cxx | 1 + Source/cmQtAutoGeneratorInitializer.cxx | 2 +- Source/cmSystemTools.cxx | 2 +- Source/cmSystemTools.h | 6 ------ Source/cmWriteFileCommand.cxx | 5 +---- Source/cm_sys_stat.h | 14 ++++++++++++++ Source/cmake.cxx | 5 +---- 17 files changed, 29 insertions(+), 39 deletions(-) create mode 100644 Source/cm_sys_stat.h 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 #include -#include -// include sys/stat.h after sys/types.h -#include +#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 +#include "cm_sys_stat.h" #include #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 #include @@ -16,7 +17,6 @@ #include #include #include -#include #include // 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 -#include #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 #include -#include -// include sys/stat.h after sys/types.h -#include - #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 -#include #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 #include -#include #include 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 #include -#include -// include sys/stat.h after sys/types.h -#include - #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 +#include "cm_sys_stat.h" #define cmFileTimeComparison_Type struct stat #else #include 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 -#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 #include #include -#include #include #include 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 #include #include -#include #include #include 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 #include -#if defined(_MSC_VER) -typedef unsigned short mode_t; -#else -#include -#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 -#include -// include sys/stat.h after sys/types.h -#include - #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 +// include sys/stat.h after sys/types.h +#include + +#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 @@ -106,10 +107,6 @@ #include #endif -#include -// include sys/stat.h after sys/types.h -#include // struct stat - #include #include #include -- cgit v0.12