Browse Source

[libc] 修复difftime函数在IAR下的编译错误

Meco Man 2 years ago
parent
commit
a924da830e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      components/libc/compilers/common/ctime.c

+ 2 - 0
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 */