ERR: Fix for borland on linux. We cannot directly compare the st_dev and st_ino members of struct stat. Use memcmp instead.

This commit is contained in:
Brad King 2002-09-10 15:38:26 -04:00
parent 1bad75e8a2
commit 807b4ac47f

View File

@ -31,7 +31,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
#if defined(_MSC_VER) || defined(__BORLANDC__) #if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__))
#include <string.h> #include <string.h>
#include <windows.h> #include <windows.h>
#include <direct.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 // see if the files are the same file
// check the device inode and size // check the device inode and size
if(fileStat2.st_dev == fileStat1.st_dev && if(memcmp(&fileStat2.st_dev, &fileStat1.st_dev, sizeof(fileStat1.st_dev)) == 0 &&
fileStat2.st_ino == fileStat1.st_ino && memcmp(&fileStat2.st_ino, &fileStat1.st_ino, sizeof(fileStat1.st_ino)) == 0 &&
fileStat2.st_size == fileStat1.st_size fileStat2.st_size == fileStat1.st_size
) )
{ {