diff options
| author | Jianting (Meco) Man <[email protected]> | 2021-10-14 20:11:01 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-14 20:11:01 -0400 |
| commit | 8c01acc667898be1674cf0be3f2c21c2cedaa329 (patch) | |
| tree | 023ef8735104687ea14929a719e6fd20498c59c9 /components/libc/compilers/armlibc | |
| parent | 92ea0ec8c7a42cd366c5285c1e55fc7d21dcdf93 (diff) | |
Revert "[libc]&[dfs] remove unnecessary RT_USING_POSIX and RT_USING_DFS_DEVFS"
Diffstat (limited to 'components/libc/compilers/armlibc')
| -rw-r--r-- | components/libc/compilers/armlibc/libc.c | 12 | ||||
| -rw-r--r-- | components/libc/compilers/armlibc/syscalls.c | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/components/libc/compilers/armlibc/libc.c b/components/libc/compilers/armlibc/libc.c index 82f42f5047..889c687309 100644 --- a/components/libc/compilers/armlibc/libc.c +++ b/components/libc/compilers/armlibc/libc.c @@ -17,23 +17,23 @@ int libc_system_init(void) { -#ifdef RT_USING_DFS_DEVFS +#if defined(RT_USING_DFS) & defined(RT_USING_DFS_DEVFS) rt_device_t dev_console; dev_console = rt_console_get_device(); if (dev_console) { - #ifdef RT_USING_POSIX + #if defined(RT_USING_POSIX) libc_stdio_set_console(dev_console->parent.name, O_RDWR); #else libc_stdio_set_console(dev_console->parent.name, O_WRONLY); - #endif /* RT_USING_POSIX */ + #endif } -#endif /* RT_USING_DFS_DEVFS */ +#endif -#if defined(RT_USING_PTHREADS) && !defined(RT_USING_COMPONENTS_INIT) +#if defined RT_USING_PTHREADS && !defined RT_USING_COMPONENTS_INIT pthread_system_init(); -#endif /* defined(RT_USING_PTHREADS) && !defined(RT_USING_COMPONENTS_INIT) */ +#endif return 0; } diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c index 0142c3335d..ccdcfc86ea 100644 --- a/components/libc/compilers/armlibc/syscalls.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -187,14 +187,14 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode) { #ifdef RT_USING_DFS int size; -#endif /* RT_USING_DFS */ +#endif if ((fh == STDOUT) || (fh == STDERR)) { #if !defined(RT_USING_CONSOLE) || !defined(RT_USING_DEVICE) return 0; #else -#ifdef RT_USING_DFS +#ifdef RT_USING_POSIX if (libc_stdio_get_console() < 0) { LOG_W("Do not invoke standard input before initializing libc"); @@ -210,8 +210,8 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode) } return -1; -#endif /* RT_USING_DFS */ -#endif /* !defined(RT_USING_CONSOLE) || !defined(RT_USING_DEVICE) */ +#endif +#endif } else if (fh == STDIN) { @@ -226,7 +226,7 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode) return len - size; else return -1; -#endif /* RT_USING_DFS */ +#endif } /* |
