summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-08-05 20:29:07 (GMT)
committerBrad King <brad.king@kitware.com>2020-08-05 20:29:07 (GMT)
commit05e3abafa50758e709c9e9dbeb40f4cb1fe72063 (patch)
tree46cb7267772342f325466036ee993db87196a6fa /Source/kwsys/SystemTools.cxx
parentb26c35620cdbf8dcf068edd2d32a4f1aff0e4f61 (diff)
parent82fd6850437b955f20eeb7ae68f520a2d5f4a1ab (diff)
downloadCMake-05e3abafa50758e709c9e9dbeb40f4cb1fe72063.zip
CMake-05e3abafa50758e709c9e9dbeb40f4cb1fe72063.tar.gz
CMake-05e3abafa50758e709c9e9dbeb40f4cb1fe72063.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream * upstream-KWSys: KWSys 2020-08-05 (185dd56e)
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx44
1 files changed, 2 insertions, 42 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 2c39b91..6144d9c 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -96,19 +96,12 @@
# if defined(_MSC_VER) && _MSC_VER >= 1800
# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
# endif
-#elif defined(__CYGWIN__)
-# include <windows.h>
-# undef _WIN32
#endif
#if !KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
extern char** environ;
#endif
-#ifdef __CYGWIN__
-# include <sys/cygwin.h>
-#endif
-
// getpwnam doesn't exist on Windows and Cray Xt3/Catamount
// same for TIOCGWINSZ
#if defined(_WIN32) || defined(__LIBCATAMOUNT__) || \
@@ -1290,15 +1283,7 @@ bool SystemTools::PathExists(const std::string& path)
if (path.empty()) {
return false;
}
-#if defined(__CYGWIN__)
- // Convert path to native windows path if possible.
- char winpath[MAX_PATH];
- if (SystemTools::PathCygwinToWin32(path.c_str(), winpath)) {
- return (GetFileAttributesA(winpath) != INVALID_FILE_ATTRIBUTES);
- }
- struct stat st;
- return lstat(path.c_str(), &st) == 0;
-#elif defined(_WIN32)
+#if defined(_WIN32)
return (GetFileAttributesW(Encoding::ToWindowsExtendedPath(path).c_str()) !=
INVALID_FILE_ATTRIBUTES);
#else
@@ -1320,14 +1305,7 @@ bool SystemTools::FileExists(const std::string& filename)
if (filename.empty()) {
return false;
}
-#if defined(__CYGWIN__)
- // Convert filename to native windows path if possible.
- char winpath[MAX_PATH];
- if (SystemTools::PathCygwinToWin32(filename.c_str(), winpath)) {
- return (GetFileAttributesA(winpath) != INVALID_FILE_ATTRIBUTES);
- }
- return access(filename.c_str(), R_OK) == 0;
-#elif defined(_WIN32)
+#if defined(_WIN32)
DWORD attr =
GetFileAttributesW(Encoding::ToWindowsExtendedPath(filename).c_str());
if (attr == INVALID_FILE_ATTRIBUTES) {
@@ -1433,24 +1411,6 @@ int SystemTools::Stat(const std::string& path, SystemTools::Stat_t* buf)
#endif
}
-#ifdef __CYGWIN__
-bool SystemTools::PathCygwinToWin32(const char* path, char* win32_path)
-{
- auto itr = SystemToolsStatics->Cyg2Win32Map.find(path);
- if (itr != SystemToolsStatics->Cyg2Win32Map.end()) {
- strncpy(win32_path, itr->second.c_str(), MAX_PATH);
- } else {
- if (cygwin_conv_path(CCP_POSIX_TO_WIN_A, path, win32_path, MAX_PATH) !=
- 0) {
- win32_path[0] = 0;
- }
- SystemToolsStatics->Cyg2Win32Map.insert(
- SystemToolsStatic::StringMap::value_type(path, win32_path));
- }
- return win32_path[0] != 0;
-}
-#endif
-
bool SystemTools::Touch(const std::string& filename, bool create)
{
if (!SystemTools::FileExists(filename)) {