From bb1084556ff9395e6e5d908edfef9cab6f6fa4dc Mon Sep 17 00:00:00 2001 From: "Man, Jianting (Meco)" <920369182@qq.com> Date: Sat, 8 Jan 2022 10:29:41 -0500 Subject: [console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题 * format codes * [libc] 整理格式 * refresh projects --- components/libc/compilers/dlib/syscall_close.c | 1 + components/libc/compilers/dlib/syscall_lseek.c | 1 + components/libc/compilers/dlib/syscall_mem.c | 1 + components/libc/compilers/dlib/syscall_remove.c | 1 + components/libc/compilers/dlib/syscall_write.c | 4 ++-- components/libc/compilers/dlib/syscalls.c | 1 + 6 files changed, 7 insertions(+), 2 deletions(-) (limited to 'components/libc/compilers/dlib') 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 #include #include 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 #include #include 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 #include 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 #include #include 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 /* for exit() and abort() */ -- cgit v1.3.1