From 6910a9e97b93ed7d60042b3a78439cdfe82e50ee Mon Sep 17 00:00:00 2001 From: zhangjun <2281979437@qq.com> Date: Tue, 27 Aug 2019 15:03:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DIAR8.1=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=9A=84=5F=5Flocaltime32=E7=AD=89=E9=87=8D?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/common/time.c | 40 ++----------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index 0ab9f6980..ed7a23207 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -8,13 +8,10 @@ * 2019-08-21 zhangjun copy from minilibc */ -#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined (__IAR_SYSTEMS_ICC__) #include #include -/* seconds per day */ -#define SPD 24*60*60 - +#if !defined (__IAR_SYSTEMS_ICC__) /* days per month -- nonleap! */ const short __spm[13] = @@ -93,15 +90,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *r) return r; } -#if defined (__IAR_SYSTEMS_ICC__) && (__VER__) >= 6020000 -#if _DLIB_TIME_USES_64 -struct tm* __gmtime64(const time_t* t) -#else -struct tm* __gmtime32(const time_t* t) -#endif -#else struct tm* gmtime(const time_t* t) -#endif { static struct tm tmp; return gmtime_r(t, &tmp); @@ -113,29 +102,13 @@ struct tm* localtime_r(const time_t* t, struct tm* r) return gmtime_r(t, r); } -#if defined (__IAR_SYSTEMS_ICC__) && (__VER__) >= 6020000 -#if _DLIB_TIME_USES_64 -struct tm* __localtime64(const time_t* t) -#else -struct tm* __localtime32(const time_t* t) -#endif -#else struct tm* localtime(const time_t* t) -#endif { static struct tm tmp; return localtime_r(t, &tmp); } -#if defined (__IAR_SYSTEMS_ICC__) && (__VER__) >= 6020000 -#if _DLIB_TIME_USES_64 -time_t __mktime64(struct tm * const t) -#else -time_t __mktime32(struct tm * const t) -#endif -#else time_t mktime(struct tm * const t) -#endif { register time_t day; register time_t i; @@ -242,15 +215,7 @@ char* asctime(const struct tm *timeptr) return asctime_r(timeptr, buf); } -#if defined (__IAR_SYSTEMS_ICC__) && (__VER__) >= 6020000 -#if _DLIB_TIME_USES_64 -char* __ctime64(const time_t *timep) -#else -char* __ctime32(const time_t *timep) -#endif -#else char* ctime(const time_t *timep) -#endif { return asctime(localtime(timep)); } @@ -285,6 +250,8 @@ int _gettimeofday( struct timeval *tv, void *ignore) } #endif +#endif /* __IAR_SYSTEMS_ICC__ */ + /** * Returns the current time. * @@ -340,4 +307,3 @@ RT_WEAK clock_t clock(void) { return rt_tick_get(); } -#endif -- GitLab