summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-09-10 19:38:26 (GMT)
committerBrad King <brad.king@kitware.com>2002-09-10 19:38:26 (GMT)
commit807b4ac47f9db38bfd77a2a9d5e6be9959f9bf82 (patch)
tree9681ad2b8ef97dd304bac58c0a853740c7882627 /Source/cmSystemTools.cxx
parent1bad75e8a2bf2cfab2c8780a3f2440bc2f446ddd (diff)
downloadCMake-807b4ac47f9db38bfd77a2a9d5e6be9959f9bf82.zip
CMake-807b4ac47f9db38bfd77a2a9d5e6be9959f9bf82.tar.gz
CMake-807b4ac47f9db38bfd77a2a9d5e6be9959f9bf82.tar.bz2
ERR: Fix for borland on linux. We cannot directly compare the st_dev and st_ino members of struct stat. Use memcmp instead.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index e800710..2e17358 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -31,7 +31,7 @@
#include <sys/wait.h>
#endif
-#if defined(_MSC_VER) || defined(__BORLANDC__)
+#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__))
#include <string.h>
#include <windows.h>
#include <direct.h>
@@ -549,8 +549,8 @@ bool cmSystemTools::SameFile(const char* file1, const char* file2)
{
// see if the files are the same file
// check the device inode and size
- if(fileStat2.st_dev == fileStat1.st_dev &&
- fileStat2.st_ino == fileStat1.st_ino &&
+ if(memcmp(&fileStat2.st_dev, &fileStat1.st_dev, sizeof(fileStat1.st_dev)) == 0 &&
+ memcmp(&fileStat2.st_ino, &fileStat1.st_ino, sizeof(fileStat1.st_ino)) == 0 &&
fileStat2.st_size == fileStat1.st_size
)
{