From f021cb982a1add837755af2c513ab17605a55f2d Mon Sep 17 00:00:00 2001 From: mysterywolf <920369182@qq.com> Date: Tue, 8 Sep 2020 10:52:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9common=E4=B8=8B=E7=9A=84scons?= =?UTF-8?q?cript=E8=84=9A=E6=9C=AC=E6=96=87=E4=BB=B6=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0unistd.c=E6=8E=92=E9=99=A4=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/compilers/common/SConscript | 3 +++ components/libc/compilers/common/unistd.c | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 7979e20944..deadacb426 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -13,6 +13,9 @@ else: if GetDepend('RT_LIBC_USING_TIME'): src += ['time.c'] +if GetDepend('RT_USING_POSIX') == False: + SrcRemove(src, ['unistd.c']) + group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) Return('group') diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common/unistd.c index e2f2827beb..4068fc5cf5 100644 --- a/components/libc/compilers/common/unistd.c +++ b/components/libc/compilers/common/unistd.c @@ -8,12 +8,11 @@ * 2020-09-01 Meco Man First Version */ -#include #include -#ifdef RT_USING_POSIX - #ifdef RT_USING_POSIX_TERMIOS +#include + int isatty(int fd) { struct termios ts; @@ -25,5 +24,3 @@ char *ttyname(int fd) { return "/dev/tty0"; /*TODO: need to add more specific*/ } - -#endif