summaryrefslogtreecommitdiff
path: root/components/libc/compilers/dlib
diff options
context:
space:
mode:
authorWayne Lin <[email protected]>2022-01-10 12:36:11 +0800
committerWayne Lin <[email protected]>2022-01-10 12:36:11 +0800
commit715eecd3eb6cfbbc95aba4fdf932db2e1a7698fb (patch)
tree111003eb53eaa4a789729792a622d2abfd602031 /components/libc/compilers/dlib
parent6d2a7d00db2808f26b96efaebfa3aa18b6fd47b8 (diff)
parent5206f6504018d1e1978e1c547f6a5b782d505be5 (diff)
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton
# Conflicts: # bsp/nuvoton/nk-980iot/.config # bsp/nuvoton/nk-n9h30/.config # bsp/nuvoton/nk-rtu980/.config # bsp/nuvoton/numaker-iot-m487/.config # bsp/nuvoton/numaker-m2354/.config # bsp/nuvoton/numaker-pfm-m487/.config
Diffstat (limited to 'components/libc/compilers/dlib')
-rw-r--r--components/libc/compilers/dlib/syscall_close.c1
-rw-r--r--components/libc/compilers/dlib/syscall_lseek.c1
-rw-r--r--components/libc/compilers/dlib/syscall_mem.c1
-rw-r--r--components/libc/compilers/dlib/syscall_read.c10
-rw-r--r--components/libc/compilers/dlib/syscall_remove.c1
-rw-r--r--components/libc/compilers/dlib/syscall_write.c4
-rw-r--r--components/libc/compilers/dlib/syscalls.c1
7 files changed, 12 insertions, 7 deletions
diff --git a/components/libc/compilers/dlib/syscall_close.c b/components/libc/compilers/dlib/syscall_close.c
index 294c81f6c0..736023023d 100644
--- a/components/libc/compilers/dlib/syscall_close.c
+++ b/components/libc/compilers/dlib/syscall_close.c
@@ -7,6 +7,7 @@
* Date Author Notes
* 2015-01-28 Bernard first version
*/
+
#include <rtthread.h>
#include <LowLevelIOInterface.h>
#include <unistd.h>
diff --git a/components/libc/compilers/dlib/syscall_lseek.c b/components/libc/compilers/dlib/syscall_lseek.c
index 3bfec38998..b2c47e71c9 100644
--- a/components/libc/compilers/dlib/syscall_lseek.c
+++ b/components/libc/compilers/dlib/syscall_lseek.c
@@ -7,6 +7,7 @@
* Date Author Notes
* 2015-01-28 Bernard first version
*/
+
#include <rtthread.h>
#include <LowLevelIOInterface.h>
#include <unistd.h>
diff --git a/components/libc/compilers/dlib/syscall_mem.c b/components/libc/compilers/dlib/syscall_mem.c
index 57060da842..2de0974e4e 100644
--- a/components/libc/compilers/dlib/syscall_mem.c
+++ b/components/libc/compilers/dlib/syscall_mem.c
@@ -8,6 +8,7 @@
* 2015-01-28 Bernard first version
* 2021-11-13 Meco Man implement no-heap warning
*/
+
#include <rtthread.h>
#include <stddef.h>
diff --git a/components/libc/compilers/dlib/syscall_read.c b/components/libc/compilers/dlib/syscall_read.c
index db523cc0a6..a276a3e401 100644
--- a/components/libc/compilers/dlib/syscall_read.c
+++ b/components/libc/compilers/dlib/syscall_read.c
@@ -11,9 +11,9 @@
#include <rtthread.h>
#include <LowLevelIOInterface.h>
#include <unistd.h>
-#ifdef RT_USING_POSIX_DEVIO
+#ifdef RT_USING_POSIX_STDIO
#include "libc.h"
-#endif /* RT_USING_POSIX_DEVIO */
+#endif /* RT_USING_POSIX_STDIO */
#include <compiler_private.h>
#define DBG_TAG "dlib.syscall.read"
#define DBG_LVL DBG_INFO
@@ -39,7 +39,7 @@ size_t __read(int handle, unsigned char *buf, size_t len)
if (handle == _LLIO_STDIN)
{
-#ifdef RT_USING_POSIX_DEVIO
+#ifdef RT_USING_POSIX_STDIO
if (libc_stdio_get_console() < 0)
{
LOG_W("Do not invoke standard input before initializing Compiler");
@@ -47,9 +47,9 @@ size_t __read(int handle, unsigned char *buf, size_t len)
}
return read(STDIN_FILENO, buf, len); /* return the length of the data read */
#else
- LOG_W(_WARNING_WITHOUT_DEVIO);
+ LOG_W(_WARNING_WITHOUT_STDIO);
return _LLIO_ERROR;
-#endif /* RT_USING_POSIX_DEVIO */
+#endif /* RT_USING_POSIX_STDIO */
}
else if ((handle == _LLIO_STDOUT) || (handle == _LLIO_STDERR))
{
diff --git a/components/libc/compilers/dlib/syscall_remove.c b/components/libc/compilers/dlib/syscall_remove.c
index 40c51164a9..04230544da 100644
--- a/components/libc/compilers/dlib/syscall_remove.c
+++ b/components/libc/compilers/dlib/syscall_remove.c
@@ -7,6 +7,7 @@
* Date Author Notes
* 2015-01-28 Bernard first version
*/
+
#include <rtthread.h>
#include <LowLevelIOInterface.h>
#include <unistd.h>
diff --git a/components/libc/compilers/dlib/syscall_write.c b/components/libc/compilers/dlib/syscall_write.c
index 3af08daba9..4eead9aa38 100644
--- a/components/libc/compilers/dlib/syscall_write.c
+++ b/components/libc/compilers/dlib/syscall_write.c
@@ -40,7 +40,7 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
if ((handle == _LLIO_STDOUT) || (handle == _LLIO_STDERR))
{
-#ifdef RT_USING_CONSOLE
+#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
rt_device_t console_device;
console_device = rt_console_get_device();
@@ -52,7 +52,7 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
return len; /* return the length of the data written */
#else
return _LLIO_ERROR;
-#endif /* RT_USING_CONSOLE */
+#endif /* defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) */
}
else if (handle == _LLIO_STDIN)
{
diff --git a/components/libc/compilers/dlib/syscalls.c b/components/libc/compilers/dlib/syscalls.c
index 1ee6a3bc12..391cbcac8a 100644
--- a/components/libc/compilers/dlib/syscalls.c
+++ b/components/libc/compilers/dlib/syscalls.c
@@ -7,6 +7,7 @@
* Date Author Notes
* 2021-02-13 Meco Man implement exit() and abort()
*/
+
#include <rtthread.h>
/* for exit() and abort() */