From b706548e6cd5c8d9c281529086779c233a23df47 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 27 Jan 2020 02:13:22 -0500 Subject: [PATCH] Fix MinGW compile Also see https://groups.google.com/d/msg/cryptopp-users/fVLk79sIBEE/Euhu6x9nAQAJ --- validate.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/validate.h b/validate.h index 7695e692..7af6c378 100644 --- a/validate.h +++ b/validate.h @@ -212,6 +212,9 @@ inline std::string TimeToString(const time_t& t) CRYPTOPP_ASSERT(err == 0); std::string str(err == 0 ? timeBuf : ""); +#elif defined(__MINGW32__) || defined(__MINGW64__) + char* timeString = ::asctime(::localtime(&t)); + std::string str(timeString ? timeString : ""); #elif (_POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE || defined(_POSIX_SOURCE)) tm localTime; char timeBuf[64];