From 9ce47c178dfbc74a26a894256999876fc63576b6 Mon Sep 17 00:00:00 2001 From: Laurie Date: Mon, 26 Jul 2021 18:35:53 -0400 Subject: [PATCH] timeval cast for win64 --- src/common/mgen.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/mgen.cpp b/src/common/mgen.cpp index 9e38657f..c95bd39f 100644 --- a/src/common/mgen.cpp +++ b/src/common/mgen.cpp @@ -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()