diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-01-12 18:53:46 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-01-12 18:53:46 (GMT) |
commit | e5bcc9244b885cdb5672a3691896a542521738ca (patch) | |
tree | 8d39bd110bcdff4a0012148deeed34234dc21dd2 /Source/kwsys | |
parent | b4bf41434c048a47e55302b74ee54f9c097d32ed (diff) | |
download | CMake-e5bcc9244b885cdb5672a3691896a542521738ca.zip CMake-e5bcc9244b885cdb5672a3691896a542521738ca.tar.gz CMake-e5bcc9244b885cdb5672a3691896a542521738ca.tar.bz2 |
ENH: use access over stat for performance
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 04d8e08..bb138d1 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -37,6 +37,9 @@ #endif #if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__)) +#include <io.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include <windows.h> #include <direct.h> @@ -626,8 +629,10 @@ bool SystemTools::SameFile(const char* file1, const char* file2) // return true if the file exists bool SystemTools::FileExists(const char* filename) { -// struct stat fs; -// if (stat(filename, &fs) != 0) +#ifdef _MSC_VER +# define access _access +# define F_OK 0 +#endif if ( access(filename, F_OK) != 0 ) { return false; |