Skip to content

Commit

Permalink
Merge pull request #31 from USNavalResearchLaboratory/working/nrl/ljt…
Browse files Browse the repository at this point in the history
…/win64-time-fix

timeval cast for win64
  • Loading branch information
bebopagogo authored Jul 27, 2021
2 parents 2432b49 + 9ce47c1 commit a3dbc75
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 a3dbc75

Please sign in to comment.