From 673dcf74ae3cfd7fe4ac7b3a35b2eaef0204363c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=99=E4=BF=A1=E8=AA=A0?= Date: Fri, 19 Nov 2021 13:43:33 +0800 Subject: [PATCH] Update Util.h BCB 6 not support gmtime_s and localtime_s, is C11 function. --- include/plog/Util.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/plog/Util.h b/include/plog/Util.h index 3470ede2..6e29aae4 100644 --- a/include/plog/Util.h +++ b/include/plog/Util.h @@ -86,8 +86,10 @@ namespace plog inline void localtime_s(struct tm* t, const time_t* time) { -#if defined(_WIN32) && defined(__BORLANDC__) +#if defined(_WIN32) && defined(__BORLANDC__) && __BORLANDC__ > 0x0560 ::localtime_s(time, t); +#elif defined(_WIN32) && defined(__BORLANDC__) && __BORLANDC__ <= 0x0560 + *t = *::localtime(time); #elif defined(_WIN32) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) *t = *::localtime(time); #elif defined(_WIN32) @@ -99,8 +101,10 @@ namespace plog inline void gmtime_s(struct tm* t, const time_t* time) { -#if defined(_WIN32) && defined(__BORLANDC__) +#if defined(_WIN32) && defined(__BORLANDC__) && __BORLANDC__ > 0x0560 ::gmtime_s(time, t); +#elif defined(_WIN32) && defined(__BORLANDC__) && __BORLANDC__ <= 0x0560 + *t = *::gmtime(time); #elif defined(_WIN32) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) *t = *::gmtime(time); #elif defined(_WIN32)