From 6eb6752398901671ae7d7076d8f363196724b991 Mon Sep 17 00:00:00 2001 From: armink Date: Thu, 15 Apr 2021 14:12:02 +0800 Subject: [PATCH] [libc/time] Fix MDK build error when using gmtime_r. --- components/libc/compilers/common/sys/time.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/libc/compilers/common/sys/time.h b/components/libc/compilers/common/sys/time.h index 2a40b7b805..b3adaedfab 100644 --- a/components/libc/compilers/common/sys/time.h +++ b/components/libc/compilers/common/sys/time.h @@ -57,6 +57,10 @@ time_t timegm(struct tm * const t); int gettimeofday(struct timeval *tv, struct timezone *tz); int settimeofday(const struct timeval *tv, const struct timezone *tz); +#if defined(__ARMCC_VERSION) || defined (__ICCARM__) +struct tm *gmtime_r(const time_t *timep, struct tm *r); +#endif + #ifdef RT_USING_POSIX #include /* posix clock and timer */