summaryrefslogtreecommitdiff
path: root/components/libc/compilers
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2022-07-17 02:58:43 -0400
committerguo <[email protected]>2022-07-20 10:07:03 +0800
commita924da830e0105c981bef650cb1391e9580e819d (patch)
tree9b6c2a17c2162cc4656d0d1b688ce21162fb7505 /components/libc/compilers
parentddec9facd522366cf6fc0b523dfcf206af8c0620 (diff)
[libc] 修复difftime函数在IAR下的编译错误
Diffstat (limited to 'components/libc/compilers')
-rw-r--r--components/libc/compilers/common/ctime.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/components/libc/compilers/common/ctime.c b/components/libc/compilers/common/ctime.c
index 6cef1e222d..34d646ff9d 100644
--- a/components/libc/compilers/common/ctime.c
+++ b/components/libc/compilers/common/ctime.c
@@ -324,10 +324,12 @@ char* ctime(const time_t *tim_p)
}
RTM_EXPORT(ctime);
+#ifndef __ICCARM__
double difftime(time_t time1, time_t time2)
{
return (double)(time1 - time2);
}
+#endif /* __ICCARM__ */
RTM_EXPORT(difftime);
RTM_EXPORT(strftime); /* inherent in the toolchain */