diff options
author | marha <marha@users.sourceforge.net> | 2010-02-18 07:22:26 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-02-18 07:22:26 +0000 |
commit | 24d6ec0750afd0c393bab09aabe174da824a8c56 (patch) | |
tree | c856ef924b12b5f1a88809208c38438cc874e6a1 /tools/mhmake/src/fileinfo.cpp | |
parent | 5a30da03ddafd49caf68942f7ddf021bd898ef6d (diff) | |
download | vcxsrv-24d6ec0750afd0c393bab09aabe174da824a8c56.tar.gz vcxsrv-24d6ec0750afd0c393bab09aabe174da824a8c56.tar.bz2 vcxsrv-24d6ec0750afd0c393bab09aabe174da824a8c56.zip |
svn merge --reintegrate ^/branches/mhmake.parallel .
Diffstat (limited to 'tools/mhmake/src/fileinfo.cpp')
-rw-r--r-- | tools/mhmake/src/fileinfo.cpp | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/tools/mhmake/src/fileinfo.cpp b/tools/mhmake/src/fileinfo.cpp index 387b2816d..e0feb0a79 100644 --- a/tools/mhmake/src/fileinfo.cpp +++ b/tools/mhmake/src/fileinfo.cpp @@ -25,13 +25,13 @@ #include "util.h"
#include "mhmakeparser.h"
+#ifndef S_ISDIR
+#define S_ISDIR(val) ((val)&_S_IFDIR)
+#endif
+
const string NullString;
refptr<fileinfo> NullFileInfo;
-#ifdef WIN32
-ZEROTIME g_ZeroTime;
-#endif
-
///////////////////////////////////////////////////////////////////////////////
string QuoteFileName(const string &Filename)
{
@@ -92,27 +92,6 @@ string fileinfo::GetName() const ///////////////////////////////////////////////////////////////////////////////
mh_time_t fileinfo::realGetDate()
{
-#ifdef WIN32
- WIN32_FIND_DATA FindData;
- HANDLE hFind=FindFirstFile(m_AbsFileName.c_str(),&FindData);
- if (hFind==INVALID_HANDLE_VALUE)
- {
- m_Date.SetNotExist();
- }
- else
- {
- FindClose(hFind);
- if (FindData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
- { // For directories we just take an old time since the lastwritetime is changed each time something
- // is added to the directory
- m_Date.SetDir();
- }
- else
- {
- m_Date=g_ZeroTime.ConvertTime(&FindData.ftLastWriteTime);
- }
- }
-#else
struct stat Buf;
if (-1==stat(m_AbsFileName.c_str(),&Buf))
m_Date.SetNotExist();
@@ -120,7 +99,6 @@ mh_time_t fileinfo::realGetDate() m_Date.SetDir();
else
m_Date=Buf.st_mtime;
-#endif
return m_Date;
}
@@ -157,16 +135,12 @@ bool fileinfo::IsDir() const }
///////////////////////////////////////////////////////////////////////////////
+#ifdef _DEBUG
void fileinfo::SetDateToNow()
{
-#ifdef WIN32
- FILETIME FileTime;
- GetSystemTimeAsFileTime(&FileTime);
- m_Date=g_ZeroTime.ConvertTime(&FileTime);
-#else
m_Date=time(NULL);
-#endif
}
+#endif
///////////////////////////////////////////////////////////////////////////////
string fileinfo::GetPrerequisits() const
@@ -252,7 +226,7 @@ string fileinfo::GetErrorMessageDuplicateRule(const refptr<rule>&pRule) #endif
///////////////////////////////////////////////////////////////////////////////
-static inline string &NormalizePathName(string &Name)
+string &NormalizePathName(string &Name)
{
const char *pPtr=Name.c_str();
const char *pBeg=pPtr;
|