Skip to content

Commit

Permalink
timeval cast for win64
Browse files Browse the repository at this point in the history
  • Loading branch information
ljt-git committed Jul 26, 2021
1 parent 2432b49 commit 9ce47c1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/common/mgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,15 @@ void Mgen::LogLegacyTimestamp(FILE* filePtr, const struct timeval& theTime, bool
struct tm* timePtr = &timeStruct;
#else
struct tm* timePtr;
time_t secs = theTime.tv_sec;

if (localTime)
timePtr = localtime((time_t*)&theTime.tv_sec);
timePtr = localtime((time_t*)&secs);
else
timePtr = gmtime((time_t*)&theTime.tv_sec);
timePtr = gmtime((time_t*)&secs);

#endif // if/else _WIN32_WCE
Mgen::Log(filePtr, "%02d:%02d:%02d.%06lu ",
Mgen::Log(filePtr, "%02d:%02d:%02d.%06lu ",
timePtr->tm_hour, timePtr->tm_min, timePtr->tm_sec,
(UINT32)theTime.tv_usec);
} // end Mgen::LogTimeStamp()
Expand Down

0 comments on commit 9ce47c1

Please sign in to comment.