summaryrefslogtreecommitdiff
path: root/components/libc
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-11-24 09:14:46 -0500
committerMeco Man <[email protected]>2021-11-24 09:47:55 -0500
commit7c789d4b11c13e45ab1d2a858c68dabb022eb07c (patch)
tree084b7a54eebb1ad0574111a429d24b51bc9f6271 /components/libc
parentbd80b7a4a15a2e97b13bbda69af8e909be544100 (diff)
revise some RT_USING_POSIX to RT_USING_POSIX_DEVIO
Diffstat (limited to 'components/libc')
-rw-r--r--components/libc/compilers/common/sys/ioctl.h2
-rw-r--r--components/libc/posix/aio/SConscript2
-rw-r--r--components/libc/posix/src/libc.c9
-rw-r--r--components/libc/posix/src/libc.h4
-rw-r--r--components/libc/posix/termios/SConscript4
5 files changed, 8 insertions, 13 deletions
diff --git a/components/libc/compilers/common/sys/ioctl.h b/components/libc/compilers/common/sys/ioctl.h
index 04f73837bc..29ed3a8b84 100644
--- a/components/libc/compilers/common/sys/ioctl.h
+++ b/components/libc/compilers/common/sys/ioctl.h
@@ -11,9 +11,7 @@
#define _SYS_IOCTL_H
#include <rtconfig.h>
-#ifdef RT_USING_POSIX
#include <dfs_posix.h>
-#endif
#ifdef _WIN32
#include <winsock.h>
diff --git a/components/libc/posix/aio/SConscript b/components/libc/posix/aio/SConscript
index 445efaade5..139bc45749 100644
--- a/components/libc/posix/aio/SConscript
+++ b/components/libc/posix/aio/SConscript
@@ -6,6 +6,6 @@ cwd = GetCurrentDir()
src = Glob('*.c')
CPPPATH = [cwd]
-group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX', 'RT_USING_POSIX_AIO'], CPPPATH = CPPPATH)
+group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX_AIO'], CPPPATH = CPPPATH)
Return('group')
diff --git a/components/libc/posix/src/libc.c b/components/libc/posix/src/libc.c
index 068719d5d6..c324d84ef8 100644
--- a/components/libc/posix/src/libc.c
+++ b/components/libc/posix/src/libc.c
@@ -23,7 +23,7 @@
int libc_system_init(void)
{
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
rt_device_t dev_console;
dev_console = rt_console_get_device();
@@ -31,7 +31,7 @@ int libc_system_init(void)
{
libc_stdio_set_console(dev_console->parent.name, O_RDWR);
}
-#endif /* RT_USING_POSIX */
+#endif /* RT_USING_POSIX_DEVIO */
#if defined RT_USING_PTHREADS && !defined RT_USING_COMPONENTS_INIT
pthread_system_init();
@@ -41,8 +41,7 @@ int libc_system_init(void)
}
INIT_COMPONENT_EXPORT(libc_system_init);
-#ifdef RT_USING_POSIX
-
+#ifdef RT_USING_POSIX_DEVIO
#if defined(RT_USING_LIBC) && defined(RT_USING_NEWLIB)
#define STDIO_DEVICE_NAME_MAX 32
static FILE* std_console = NULL;
@@ -145,4 +144,4 @@ int libc_stdio_get_console(void) {
return std_fd;
}
#endif /* defined(RT_USING_LIBC) && defined(RT_USING_NEWLIB) */
-#endif /* RT_USING_POSIX */
+#endif /* RT_USING_POSIX_DEVIO */
diff --git a/components/libc/posix/src/libc.h b/components/libc/posix/src/libc.h
index f81380bf78..b019267926 100644
--- a/components/libc/posix/src/libc.h
+++ b/components/libc/posix/src/libc.h
@@ -17,10 +17,10 @@ extern "C" {
#endif
int libc_system_init(void);
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
int libc_stdio_get_console(void);
int libc_stdio_set_console(const char* device_name, int mode);
-#endif /* RT_USING_POSIX */
+#endif /* RT_USING_POSIX_DEVIO */
#ifdef __cplusplus
}
diff --git a/components/libc/posix/termios/SConscript b/components/libc/posix/termios/SConscript
index bd9a528461..3615926251 100644
--- a/components/libc/posix/termios/SConscript
+++ b/components/libc/posix/termios/SConscript
@@ -6,8 +6,6 @@ cwd = GetCurrentDir()
src = Glob('*.c') + Glob('*.cpp')
CPPPATH = [cwd]
-group = DefineGroup('POSIX', src,
- depend = ['RT_USING_LIBC', 'RT_USING_POSIX', 'RT_USING_POSIX_TERMIOS'],
- CPPPATH = CPPPATH)
+group = DefineGroup('POSIX', src, depend = ['RT_USING_LIBC', 'RT_USING_POSIX_TERMIOS'], CPPPATH = CPPPATH)
Return('group')