summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author梁生 <[email protected]>2023-10-24 21:12:10 +0800
committerGitHub <[email protected]>2023-10-24 09:12:10 -0400
commit0f5334586aac340c2153f3fef884433b9483a894 (patch)
tree26a80d6fcbc6c4a84cacb4cbfabc5ca65a921fbe
parent3c7b184f9316e38c6c1a8e4578837821bf56d802 (diff)
[libc][time]修复MDK编译环境下difftime()函数多重定义的问题 (#8174)
-rw-r--r--components/libc/compilers/common/ctime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/libc/compilers/common/ctime.c b/components/libc/compilers/common/ctime.c
index a87db1dcea..8a6ca0dc67 100644
--- a/components/libc/compilers/common/ctime.c
+++ b/components/libc/compilers/common/ctime.c
@@ -325,12 +325,12 @@ char *ctime(const time_t *tim_p)
}
RTM_EXPORT(ctime);
-#ifndef __ICCARM__
+#if (!defined __ARMCC_VERSION) && (!defined __CC_ARM) && (!defined __ICCARM__)
double difftime(time_t time1, time_t time2)
{
return (double)(time1 - time2);
}
-#endif /* __ICCARM__ */
+#endif
RTM_EXPORT(difftime);
RTM_EXPORT(strftime); /* inherent in the toolchain */