summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2022-06-30 21:15:29 -0400
committerGitHub <[email protected]>2022-07-01 09:15:29 +0800
commite1e1596cbdc44e8c2a41908117185b306df9f4a5 (patch)
tree8afe8cc8d589b46341cd967b31e85eb81a168020 /components/libc/compilers/common
parentb19602bcaab3627b9736862d015ee90ce62cf548 (diff)
[iar] 修复编译错误 (#6126)
Diffstat (limited to 'components/libc/compilers/common')
-rw-r--r--components/libc/compilers/common/cctype.c2
-rw-r--r--components/libc/compilers/common/cstdio.c2
-rw-r--r--components/libc/compilers/common/include/posix/ctype.h3
-rw-r--r--components/libc/compilers/common/include/posix/stdio.h2
4 files changed, 9 insertions, 0 deletions
diff --git a/components/libc/compilers/common/cctype.c b/components/libc/compilers/common/cctype.c
index ddcff1b39d..3bfb9fe843 100644
--- a/components/libc/compilers/common/cctype.c
+++ b/components/libc/compilers/common/cctype.c
@@ -10,12 +10,14 @@
#include "posix/ctype.h"
+#if !(defined(__ICCARM__) && (__VER__ > 9000000)) /* IAR9.0 has defined */
#ifndef isascii /* some toolchain use macro to define it */
int isascii(int c)
{
return c >= 0x00 && c <= 0x7f;
}
#endif
+#endif /* !(defined(__ICCARM__) && (__VER__ > 9000000)) */
#ifndef toascii
int toascii(int c)
diff --git a/components/libc/compilers/common/cstdio.c b/components/libc/compilers/common/cstdio.c
index 3dffe55aa7..fc14c0b9c3 100644
--- a/components/libc/compilers/common/cstdio.c
+++ b/components/libc/compilers/common/cstdio.c
@@ -13,6 +13,7 @@
#include <limits.h>
#include <sys/errno.h>
+#ifdef DFS_USING_POSIX
ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream)
{
char *cur_pos, *new_lineptr;
@@ -83,3 +84,4 @@ ssize_t getline(char **lineptr, size_t *n, FILE *stream)
{
return getdelim(lineptr, n, '\n', stream);
}
+#endif /* DFS_USING_POSIX */
diff --git a/components/libc/compilers/common/include/posix/ctype.h b/components/libc/compilers/common/include/posix/ctype.h
index 0ac42e3faf..da805af249 100644
--- a/components/libc/compilers/common/include/posix/ctype.h
+++ b/components/libc/compilers/common/include/posix/ctype.h
@@ -17,9 +17,12 @@ extern "C" {
#include <ctype.h>
+#if !(defined(__ICCARM__) && (__VER__ > 9000000)) /* IAR9.0 has defined */
#ifndef isascii /* some toolchain use macro to define it */
int isascii(int c);
#endif
+#endif /* !(defined(__ICCARM__) && (__VER__ > 9000000)) */
+
#ifndef toascii
int toascii(int c);
#endif
diff --git a/components/libc/compilers/common/include/posix/stdio.h b/components/libc/compilers/common/include/posix/stdio.h
index 7dea03bb0d..a2cf01f6b6 100644
--- a/components/libc/compilers/common/include/posix/stdio.h
+++ b/components/libc/compilers/common/include/posix/stdio.h
@@ -18,8 +18,10 @@ extern "C" {
#include <stdio.h>
#include <sys/types.h>
+#ifdef DFS_USING_POSIX
ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream);
ssize_t getline(char **lineptr, size_t *n, FILE *stream);
+#endif /* DFS_USING_POSIX */
#ifdef __cplusplus
}