diff options
| author | Man, Jianting (Meco) <[email protected]> | 2022-01-08 10:29:41 -0500 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2022-01-09 00:20:32 +0800 |
| commit | bb1084556ff9395e6e5d908edfef9cab6f6fa4dc (patch) | |
| tree | 97e0844decee5d889c1b10d88d16db36bba44245 /components/libc/compilers/gcc | |
| parent | 353f717037b57f663ddce9447fd05700f3087a66 (diff) | |
[console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题
* [console] 解决在没有定义RT_USING_DEVICE的情况下使用device报错的问题
* format codes
* [libc] 整理格式
* refresh projects
Diffstat (limited to 'components/libc/compilers/gcc')
| -rw-r--r-- | components/libc/compilers/gcc/newlib/fcntl.h | 1 | ||||
| -rw-r--r-- | components/libc/compilers/gcc/newlib/libc_syms.c | 1 | ||||
| -rw-r--r-- | components/libc/compilers/gcc/newlib/machine/time.h | 10 | ||||
| -rw-r--r-- | components/libc/compilers/gcc/newlib/syscalls.c | 4 |
4 files changed, 14 insertions, 2 deletions
diff --git a/components/libc/compilers/gcc/newlib/fcntl.h b/components/libc/compilers/gcc/newlib/fcntl.h index 239eaaef0d..847ae3d35b 100644 --- a/components/libc/compilers/gcc/newlib/fcntl.h +++ b/components/libc/compilers/gcc/newlib/fcntl.h @@ -7,6 +7,7 @@ * Date Author Notes * 2021-09-02 Meco Man First version */ + #ifndef __FCNTL_H__ #define __FCNTL_H__ diff --git a/components/libc/compilers/gcc/newlib/libc_syms.c b/components/libc/compilers/gcc/newlib/libc_syms.c index aaf6980d6b..e6ca23b393 100644 --- a/components/libc/compilers/gcc/newlib/libc_syms.c +++ b/components/libc/compilers/gcc/newlib/libc_syms.c @@ -7,6 +7,7 @@ * Date Author Notes * 2017/10/15 bernard the first version */ + #include <rtthread.h> #include <rtm.h> diff --git a/components/libc/compilers/gcc/newlib/machine/time.h b/components/libc/compilers/gcc/newlib/machine/time.h index 9ef838f892..805b061aea 100644 --- a/components/libc/compilers/gcc/newlib/machine/time.h +++ b/components/libc/compilers/gcc/newlib/machine/time.h @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-02-16 Meco Man The first version + */ + #ifndef _MACHTIME_H_ #define _MACHTIME_H_ diff --git a/components/libc/compilers/gcc/newlib/syscalls.c b/components/libc/compilers/gcc/newlib/syscalls.c index d8a8ba6945..dcf26ccfb7 100644 --- a/components/libc/compilers/gcc/newlib/syscalls.c +++ b/components/libc/compilers/gcc/newlib/syscalls.c @@ -297,7 +297,7 @@ _ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes) if (fd == STDOUT_FILENO || fd == STDERR_FILENO) { -#ifdef RT_USING_CONSOLE +#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) rt_device_t console; console = rt_console_get_device(); @@ -306,7 +306,7 @@ _ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes) #else ptr->_errno = ENOTSUP; return -1; -#endif /* RT_USING_CONSOLE */ +#endif /* defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE) */ } else if (fd == STDIN_FILENO) { |
