4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-18 19:59:13 +08:00

[libc][time]修复MDK编译环境下difftime()函数多重定义的问题 (#8174)

This commit is contained in:
梁生 2023-10-24 21:12:10 +08:00 committed by GitHub
parent 3c7b184f93
commit 0f5334586a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -325,12 +325,12 @@ char *ctime(const time_t *tim_p)
} }
RTM_EXPORT(ctime); RTM_EXPORT(ctime);
#ifndef __ICCARM__ #if (!defined __ARMCC_VERSION) && (!defined __CC_ARM) && (!defined __ICCARM__)
double difftime(time_t time1, time_t time2) double difftime(time_t time1, time_t time2)
{ {
return (double)(time1 - time2); return (double)(time1 - time2);
} }
#endif /* __ICCARM__ */ #endif
RTM_EXPORT(difftime); RTM_EXPORT(difftime);
RTM_EXPORT(strftime); /* inherent in the toolchain */ RTM_EXPORT(strftime); /* inherent in the toolchain */