diff options
author | Brad King <brad.king@kitware.com> | 2017-04-13 12:13:08 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-04-13 12:13:12 (GMT) |
commit | 26b5f7defe10edeaac763487a26ab9a101f2ed8f (patch) | |
tree | 14f5c134aa95df2c271b31e3118ae7f1e01db398 /Source/kwsys/SystemTools.hxx.in | |
parent | 8456ec833ad9b4d7e62ac91db6d2c06ee610f7e4 (diff) | |
parent | ada8e0cac4b50d07f4d07ecd584bf00e7afd3ac5 (diff) | |
download | CMake-26b5f7defe10edeaac763487a26ab9a101f2ed8f.zip CMake-26b5f7defe10edeaac763487a26ab9a101f2ed8f.tar.gz CMake-26b5f7defe10edeaac763487a26ab9a101f2ed8f.tar.bz2 |
Merge topic 'update-kwsys'
ada8e0ca Merge branch 'upstream-KWSys' into update-kwsys
85841e8b KWSys 2017-04-12 (23a4c211)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !694
Diffstat (limited to 'Source/kwsys/SystemTools.hxx.in')
-rw-r--r-- | Source/kwsys/SystemTools.hxx.in | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index 7a5256b..53abce7 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -13,6 +13,9 @@ #include <@KWSYS_NAMESPACE@/String.hxx> #include <sys/types.h> +// include sys/stat.h after sys/types.h +#include <sys/stat.h> + #if !defined(_WIN32) || defined(__CYGWIN__) #include <unistd.h> // For access permissions for use with access() #endif @@ -324,6 +327,27 @@ public: TestFilePermissions permissions); static bool TestFileAccess(const std::string& filename, TestFilePermissions permissions); +/** + * Cross platform wrapper for stat struct + */ +#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(__BORLANDC__) + typedef struct stati64 Stat_t; +#else + typedef struct _stat64 Stat_t; +#endif +#else + typedef struct stat Stat_t; +#endif + + /** + * Cross platform wrapper for stat system call + * + * On Windows this may not work for paths longer than 250 characters + * due to limitations of the underlying '_wstat64' call. + */ + static int Stat(const char* path, Stat_t* buf); + static int Stat(const std::string& path, Stat_t* buf); /** * Converts Cygwin path to Win32 path. Uses dictionary container for |