summaryrefslogtreecommitdiff
path: root/components/libc/compilers/dlib
diff options
context:
space:
mode:
authorguo <[email protected]>2021-10-28 10:30:20 +0800
committerGitHub <[email protected]>2021-10-28 10:30:20 +0800
commite0f45a6ca415804dcdb9d1e968f617878f58f809 (patch)
treef6a3fd9828abf9524c6629b52b029842e138ae8f /components/libc/compilers/dlib
parentddaa8f3f32232f4460e09f5dab9f2f5c257fec92 (diff)
parent4b9fb8f39caae9057a494611e8dae70d2809512d (diff)
Merge pull request #5239 from mysterywolf/POSIX
[libc] 消除代码中将RT_LIBC_USING_FILEIO的预编译判断条件
Diffstat (limited to 'components/libc/compilers/dlib')
-rw-r--r--components/libc/compilers/dlib/SConscript2
-rw-r--r--components/libc/compilers/dlib/syscall_close.c4
-rw-r--r--components/libc/compilers/dlib/syscall_lseek.c4
-rw-r--r--components/libc/compilers/dlib/syscall_open.c4
-rw-r--r--components/libc/compilers/dlib/syscall_read.c4
-rw-r--r--components/libc/compilers/dlib/syscall_write.c12
6 files changed, 15 insertions, 15 deletions
diff --git a/components/libc/compilers/dlib/SConscript b/components/libc/compilers/dlib/SConscript
index 3eee0e0184..348cbf311f 100644
--- a/components/libc/compilers/dlib/SConscript
+++ b/components/libc/compilers/dlib/SConscript
@@ -11,7 +11,7 @@ CPPDEFINES = ['RT_USING_DLIBC']
if rtconfig.PLATFORM == 'iar':
- if GetDepend('RT_LIBC_USING_FILEIO'):
+ if GetDepend('RT_USING_POSIX'):
from distutils.version import LooseVersion
from iar import IARVersion
diff --git a/components/libc/compilers/dlib/syscall_close.c b/components/libc/compilers/dlib/syscall_close.c
index bafe21aa4b..2897c2418a 100644
--- a/components/libc/compilers/dlib/syscall_close.c
+++ b/components/libc/compilers/dlib/syscall_close.c
@@ -18,9 +18,9 @@ int __close(int handle)
handle == _LLIO_STDERR ||
handle == _LLIO_STDIN)
return _LLIO_ERROR;
-#ifdef RT_LIBC_USING_FILEIO
+#ifdef RT_USING_POSIX
return close(handle);
#else
return _LLIO_ERROR;
-#endif /* RT_LIBC_USING_FILEIO */
+#endif /* RT_USING_POSIX */
}
diff --git a/components/libc/compilers/dlib/syscall_lseek.c b/components/libc/compilers/dlib/syscall_lseek.c
index 4a3a5c6a46..4ea55ef1c3 100644
--- a/components/libc/compilers/dlib/syscall_lseek.c
+++ b/components/libc/compilers/dlib/syscall_lseek.c
@@ -18,9 +18,9 @@ long __lseek(int handle, long offset, int whence)
handle == _LLIO_STDERR ||
handle == _LLIO_STDIN)
return _LLIO_ERROR;
-#ifdef RT_LIBC_USING_FILEIO
+#ifdef RT_USING_POSIX
return lseek(handle, offset, whence);
#else
return _LLIO_ERROR;
-#endif
+#endif /* RT_USING_POSIX */
}
diff --git a/components/libc/compilers/dlib/syscall_open.c b/components/libc/compilers/dlib/syscall_open.c
index 891b9afe58..8fb3c3a11f 100644
--- a/components/libc/compilers/dlib/syscall_open.c
+++ b/components/libc/compilers/dlib/syscall_open.c
@@ -16,7 +16,7 @@
int __open(const char *filename, int mode)
{
-#ifdef RT_LIBC_USING_FILEIO
+#ifdef RT_USING_POSIX
int handle;
int open_mode = O_RDONLY;
@@ -68,5 +68,5 @@ int __open(const char *filename, int mode)
return handle;
#else
return _LLIO_ERROR;
-#endif /* RT_LIBC_USING_FILEIO */
+#endif /* RT_USING_POSIX */
}
diff --git a/components/libc/compilers/dlib/syscall_read.c b/components/libc/compilers/dlib/syscall_read.c
index f65b502966..447ca03112 100644
--- a/components/libc/compilers/dlib/syscall_read.c
+++ b/components/libc/compilers/dlib/syscall_read.c
@@ -20,7 +20,7 @@
#pragma module_name = "?__read"
size_t __read(int handle, unsigned char *buf, size_t len)
{
-#ifdef RT_LIBC_USING_FILEIO
+#ifdef RT_USING_POSIX
int size;
if (handle == _LLIO_STDIN)
@@ -41,5 +41,5 @@ size_t __read(int handle, unsigned char *buf, size_t len)
return size;
#else
return _LLIO_ERROR;
-#endif /* RT_LIBC_USING_FILEIO */
+#endif /* RT_USING_POSIX */
}
diff --git a/components/libc/compilers/dlib/syscall_write.c b/components/libc/compilers/dlib/syscall_write.c
index af47d64a3e..ae2d4a1559 100644
--- a/components/libc/compilers/dlib/syscall_write.c
+++ b/components/libc/compilers/dlib/syscall_write.c
@@ -21,13 +21,13 @@
size_t __write(int handle, const unsigned char *buf, size_t len)
{
-#ifdef RT_LIBC_USING_FILEIO
+#ifdef RT_USING_POSIX
int size;
-#endif /* RT_LIBC_USING_FILEIO */
+#endif /* RT_USING_POSIX */
if ((handle == _LLIO_STDOUT) || (handle == _LLIO_STDERR))
{
-#ifdef RT_LIBC_USING_FILEIO
+#ifdef RT_USING_POSIX
if (libc_stdio_get_console() < 0)
{
LOG_W("Do not invoke standard output before initializing libc");
@@ -46,17 +46,17 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
return len;
#else
return _LLIO_ERROR;
-#endif /* RT_LIBC_USING_FILEIO */
+#endif /* RT_USING_POSIX */
}
else if (handle == _LLIO_STDIN)
{
return _LLIO_ERROR;
}
-#ifdef RT_LIBC_USING_FILEIO
+#ifdef RT_USING_POSIX
size = write(handle, buf, len);
return size;
#else
return _LLIO_ERROR;
-#endif /* RT_LIBC_USING_FILEIO */
+#endif /* RT_USING_POSIX */
}