#include "GitRev.h"\r
#include "Git.h"\r
\r
+// provide an ASSERT macro for when compiled without MFC\r
+#if !defined ASSERT\r
+ #ifdef _DEBUG\r
+ #define ASSERT(x) {if(!(x)) _asm{int 0x03}}\r
+ #else\r
+ #define ASSERT(x) \r
+ #endif\r
+#endif\r
+\r
+\r
GitRev::GitRev(void)\r
{\r
m_Action=0;\r
m_IsFull = 0;\r
m_IsUpdateing = 0;\r
+ // fetch local machine timezone info\r
+ if ( GetTimeZoneInformation( &m_TimeZone ) == TIME_ZONE_ID_INVALID )\r
+ {\r
+ ASSERT(false);\r
+ }\r
}\r
\r
GitRev::~GitRev(void)\r
this->m_Files.Clear();\r
m_Action=0;\r
int begintime=0;\r
- BYTE *p=&log[0];\r
int filebegin=-1;\r
\r
while( pos < log.size() && pos>=0)\r
// get local timezone\r
SYSTEMTIME sysTime;\r
tm.GetAsSystemTime( sysTime );\r
- TIME_ZONE_INFORMATION timeZone;\r
- if ( GetTimeZoneInformation( &timeZone ) == TIME_ZONE_ID_UNKNOWN )\r
+ SYSTEMTIME local;\r
+ if ( SystemTimeToTzSpecificLocalTime( &m_TimeZone, &sysTime, &local ) )\r
{\r
- ASSERT(false);\r
+ sysTime = local;\r
}\r
else\r
{\r
- SYSTEMTIME local;\r
- if ( SystemTimeToTzSpecificLocalTime( &timeZone, &sysTime, &local ) )\r
- {\r
- sysTime = local;\r
- }\r
- else\r
- {\r
- ASSERT(false);\r
- }\r
+ ASSERT(false);\r
}\r
tm = CTime( sysTime, 0 );\r
return tm;\r