diff --git a/CMakeLists.txt b/CMakeLists.txt index 84010d8b4c241642e0e11c6907d5ca7b9e3e8d17..869ae29fb0dbf925bfe1938b90b139aa96da6dd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,11 +342,6 @@ ENDIF() # capabilities and parent project's request. Enforce 0/1 as only # possible values for configuration into Configure.hxx. -IF(UNIX) - KWSYS_PLATFORM_CXX_TEST(KWSYS_STAT_HAS_ST_MTIM - "Checking whether struct stat has st_mtim member" DIRECT) -ENDIF() - # Check existence and uniqueness of long long and __int64. KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG "Checking whether C++ compiler has 'long long'" DIRECT) @@ -511,12 +506,15 @@ IF(KWSYS_USE_SystemTools) "Checking whether CXX compiler has utimes" DIRECT) KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMENSAT "Checking whether CXX compiler has utimensat" DIRECT) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_STAT_HAS_ST_MTIM + "Checking whether CXX compiler struct stat has st_mtim member" DIRECT) SET_PROPERTY(SOURCE SystemTools.cxx APPEND PROPERTY COMPILE_DEFINITIONS KWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} KWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H} KWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES} KWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT} + KWSYS_CXX_STAT_HAS_ST_MTIM=${KWSYS_CXX_STAT_HAS_ST_MTIM} ) ENDIF() diff --git a/Configure.hxx.in b/Configure.hxx.in index 3faf8620e6980ca2c06114a0caaab458f2cbe8c9..ff8e49dbae3e705b0906109d401623736cbd5346 100644 --- a/Configure.hxx.in +++ b/Configure.hxx.in @@ -18,9 +18,6 @@ /* Whether wstring is available. */ #define @KWSYS_NAMESPACE@_STL_HAS_WSTRING @KWSYS_STL_HAS_WSTRING@ -/* Whether struct stat has the st_mtim member for high resolution times. */ -#define @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM @KWSYS_STAT_HAS_ST_MTIM@ - /* If building a C++ file in kwsys itself, give the source file access to the macros without a configured namespace. */ #if defined(KWSYS_NAMESPACE) @@ -28,7 +25,6 @@ # define kwsys @KWSYS_NAMESPACE@ # endif # define KWSYS_NAME_IS_KWSYS @KWSYS_NAMESPACE@_NAME_IS_KWSYS -# define KWSYS_STAT_HAS_ST_MTIM @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM # define KWSYS_STL_HAS_WSTRING @KWSYS_NAMESPACE@_STL_HAS_WSTRING #endif diff --git a/SystemTools.cxx b/SystemTools.cxx index 262af278e7b67483f9d0e5c6c30e067054e3e1f0..7eb66e7f95b5e0ea43d26eba5335fdd56fc2f407 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -1368,7 +1368,7 @@ bool SystemTools::Touch(const std::string& filename, bool create) # if KWSYS_CXX_HAS_UTIMES struct timeval times[2] = { -# if KWSYS_STAT_HAS_ST_MTIM +# if KWSYS_CXX_STAT_HAS_ST_MTIM {st.st_atim.tv_sec, st.st_atim.tv_nsec/1000}, /* tv_sec, tv_usec */ # else {st.st_atime, 0}, @@ -1408,7 +1408,7 @@ bool SystemTools::FileTimeCompare(const std::string& f1, { return false; } -# if KWSYS_STAT_HAS_ST_MTIM +# if KWSYS_CXX_STAT_HAS_ST_MTIM // Compare using nanosecond resolution. if(s1.st_mtim.tv_sec < s2.st_mtim.tv_sec) { diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx index 94579b3f8ddc6bbc4fbace9685595cb5499b7beb..ab5ae6475a28896677eac1e528ad96ad4186898b 100644 --- a/kwsysPlatformTestsCXX.cxx +++ b/kwsysPlatformTestsCXX.cxx @@ -32,7 +32,7 @@ int main() } #endif -#ifdef TEST_KWSYS_STAT_HAS_ST_MTIM +#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM #include <sys/types.h> #include <sys/stat.h> #include <unistd.h>