From 24d6ec0750afd0c393bab09aabe174da824a8c56 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 18 Feb 2010 07:22:26 +0000 Subject: svn merge --reintegrate ^/branches/mhmake.parallel . --- tools/mhmake/src/fileinfo.h | 76 ++++++++++++++------------------------------- 1 file changed, 24 insertions(+), 52 deletions(-) (limited to 'tools/mhmake/src/fileinfo.h') diff --git a/tools/mhmake/src/fileinfo.h b/tools/mhmake/src/fileinfo.h index 9a521d4a6..146ade02b 100644 --- a/tools/mhmake/src/fileinfo.h +++ b/tools/mhmake/src/fileinfo.h @@ -137,7 +137,7 @@ class fileinfo : public refbase { string m_AbsFileName; bool m_IsPhony; - bool m_IsBuild; + int m_BuildStatus; /* Bit 0 means the target built is started, Bit 1 means the target is still building */ refptr m_pRule; vector< refptr > m_Deps; mh_time_t m_Date; @@ -150,7 +150,7 @@ public: fileinfo(const string &AbsFileName,uint32 Md5_32) { m_IsPhony=false; - m_IsBuild=false; + m_BuildStatus=0; m_AbsFileName=UnquoteFileName(AbsFileName); InvalidateDate(); m_CommandsMd5_32=Md5_32; @@ -210,7 +210,7 @@ public: void SetRule(refptr &pRule) { #if defined(_DEBUG) && defined(_MSC_VER) - if (m_pRule && m_pRule->GetCommands().size()) { + if (m_pRule && m_pRule->GetCommands().size() && !IsBuilding()) { DebugBreak(); } #endif @@ -305,7 +305,9 @@ public: return m_IsPhony; } mh_time_t realGetDate(void); +#ifdef _DEBUG void SetDateToNow(void); +#endif void SetDate(mh_time_t Date) { @@ -336,17 +338,29 @@ public: { return GetDate().DoesExist(); } + bool IsBuildStarted(void) const + { + return (m_BuildStatus&1)==1; + } bool IsBuild(void) const { - return m_IsBuild; + return m_BuildStatus==1; } void SetBuild(void) { - m_IsBuild=true; + m_BuildStatus=1; + } + bool IsBuilding(void) const + { + return (m_BuildStatus&2)==2; + } + void SetBuilding(void) + { + m_BuildStatus|=2; } - void ClearBuild(void) + void ClearBuilding(void) { - m_IsBuild=false; + m_BuildStatus&=~2; } bool IsAutoDepExtention(void) const; @@ -393,7 +407,7 @@ struct less_fileinfo : public binary_function NullFileInfo; -const refptr &GetFileInfo(const string &szName,const refptr &pRelDir=curdir::GetCurDir()); +const refptr &GetFileInfo(const string &szName,const refptr &pRelDir); extern set,less_refptrfileinfo > g_FileInfos; @@ -412,55 +426,13 @@ inline const refptr &GetAbsFileInfo(const string &strAbsName) return *pFind; } - -inline const refptr &GetFileInfo(const string &szName,const string &RelDir) -{ - return GetFileInfo(szName,GetFileInfo(RelDir)); -} - -inline const refptr &GetFileInfo(const char *szName,const char *RelDir) -{ - return GetFileInfo(string(szName),string(RelDir)); -} - -inline const refptr &GetFileInfo(const char *szName,const refptr &RelDir=curdir::GetCurDir()) +inline const refptr &GetFileInfo(const char *szName,const refptr &RelDir) { return GetFileInfo(string(szName),RelDir); } +string &NormalizePathName(string &Name); void PrintFileInfos(); -#ifdef WIN32 -class ZEROTIME -{ - __int64 m_ZeroTime; -public: - ZEROTIME() - { - SYSTEMTIME SystemTime; - - memset(&SystemTime,0,sizeof(SystemTime)); - SystemTime.wYear=1970; - SystemTime.wMonth=1; - SystemTime.wDay=1; - SystemTime.wDayOfWeek=4; - - SystemTimeToFileTime(&SystemTime,(FILETIME*)&m_ZeroTime); - } - - __int64 GetZeroTime() - { - return m_ZeroTime; - } - - mh_time_t ConvertTime(FILETIME *pFileTime) - { - return (mh_time_t)((*(__int64*)pFileTime-m_ZeroTime)/10000000); /* filetime is in nano seconds*/ - } -}; - -extern ZEROTIME g_ZeroTime; -#endif - #endif -- cgit v1.2.3