From 40c09fc1e088e1f7a9eb91c85bd30119d4a38822 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 21 Apr 2021 00:56:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=88=86=E7=B1=BB=E4=B8=BAco?= =?UTF-8?q?mmon=E6=96=87=E4=BB=B6=E5=A4=B9=E4=B8=8B=E5=B1=9Eall=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E5=92=8Cexcgcc=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/dfs/include/dfs_fs.h | 2 ++ components/libc/compilers/common/SConscript | 15 +++++++++++++++ .../{common_all => common/all}/SConscript | 0 .../compilers/{common_all => common/all}/dirent.h | 0 .../{common_all => common/all}/readme.md | 0 .../compilers/{common_all => common/all}/stdlib.c | 0 .../{common_all => common/all}/sys/ioctl.h | 0 .../{common_all => common/all}/sys/mman.h | 0 .../{common_all => common/all}/sys/statfs.h | 0 .../{common_all => common/all}/sys/termios.h | 0 .../{common_all => common/all}/sys/time.h | 0 .../{common_all => common/all}/termios.h | 0 .../compilers/{common_all => common/all}/time.c | 0 .../compilers/{common_all => common/all}/unistd.c | 0 .../excgcc}/SConscript | 0 .../{common_except_gcc => common/excgcc}/fcntl.h | 0 .../excgcc}/readme.md | 0 .../excgcc}/sys/stat.h | 0 .../excgcc}/sys/types.h | 0 .../excgcc}/sys/unistd.h | 0 .../{common_except_gcc => common/excgcc}/unistd.h | 0 include/rtlibc.h | 7 +++++++ 22 files changed, 24 insertions(+) create mode 100644 components/libc/compilers/common/SConscript rename components/libc/compilers/{common_all => common/all}/SConscript (100%) rename components/libc/compilers/{common_all => common/all}/dirent.h (100%) rename components/libc/compilers/{common_all => common/all}/readme.md (100%) rename components/libc/compilers/{common_all => common/all}/stdlib.c (100%) rename components/libc/compilers/{common_all => common/all}/sys/ioctl.h (100%) rename components/libc/compilers/{common_all => common/all}/sys/mman.h (100%) rename components/libc/compilers/{common_all => common/all}/sys/statfs.h (100%) rename components/libc/compilers/{common_all => common/all}/sys/termios.h (100%) rename components/libc/compilers/{common_all => common/all}/sys/time.h (100%) rename components/libc/compilers/{common_all => common/all}/termios.h (100%) rename components/libc/compilers/{common_all => common/all}/time.c (100%) rename components/libc/compilers/{common_all => common/all}/unistd.c (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/SConscript (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/fcntl.h (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/readme.md (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/sys/stat.h (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/sys/types.h (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/sys/unistd.h (100%) rename components/libc/compilers/{common_except_gcc => common/excgcc}/unistd.h (100%) diff --git a/components/dfs/include/dfs_fs.h b/components/dfs/include/dfs_fs.h index ed0600f1f7..828f15a0f5 100644 --- a/components/dfs/include/dfs_fs.h +++ b/components/dfs/include/dfs_fs.h @@ -12,7 +12,9 @@ #define __DFS_FS_H__ #include +#ifdef RT_USING_LIBC #include +#endif #ifdef __cplusplus extern "C" { diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript new file mode 100644 index 0000000000..4c815c49b8 --- /dev/null +++ b/components/libc/compilers/common/SConscript @@ -0,0 +1,15 @@ +# RT-Thread building script for bridge + +import os +from building import * + +cwd = GetCurrentDir() +objs = [] +list = os.listdir(cwd) + +for d in list: + path = os.path.join(cwd, d) + if os.path.isfile(os.path.join(path, 'SConscript')): + objs = objs + SConscript(os.path.join(d, 'SConscript')) + +Return('objs') diff --git a/components/libc/compilers/common_all/SConscript b/components/libc/compilers/common/all/SConscript similarity index 100% rename from components/libc/compilers/common_all/SConscript rename to components/libc/compilers/common/all/SConscript diff --git a/components/libc/compilers/common_all/dirent.h b/components/libc/compilers/common/all/dirent.h similarity index 100% rename from components/libc/compilers/common_all/dirent.h rename to components/libc/compilers/common/all/dirent.h diff --git a/components/libc/compilers/common_all/readme.md b/components/libc/compilers/common/all/readme.md similarity index 100% rename from components/libc/compilers/common_all/readme.md rename to components/libc/compilers/common/all/readme.md diff --git a/components/libc/compilers/common_all/stdlib.c b/components/libc/compilers/common/all/stdlib.c similarity index 100% rename from components/libc/compilers/common_all/stdlib.c rename to components/libc/compilers/common/all/stdlib.c diff --git a/components/libc/compilers/common_all/sys/ioctl.h b/components/libc/compilers/common/all/sys/ioctl.h similarity index 100% rename from components/libc/compilers/common_all/sys/ioctl.h rename to components/libc/compilers/common/all/sys/ioctl.h diff --git a/components/libc/compilers/common_all/sys/mman.h b/components/libc/compilers/common/all/sys/mman.h similarity index 100% rename from components/libc/compilers/common_all/sys/mman.h rename to components/libc/compilers/common/all/sys/mman.h diff --git a/components/libc/compilers/common_all/sys/statfs.h b/components/libc/compilers/common/all/sys/statfs.h similarity index 100% rename from components/libc/compilers/common_all/sys/statfs.h rename to components/libc/compilers/common/all/sys/statfs.h diff --git a/components/libc/compilers/common_all/sys/termios.h b/components/libc/compilers/common/all/sys/termios.h similarity index 100% rename from components/libc/compilers/common_all/sys/termios.h rename to components/libc/compilers/common/all/sys/termios.h diff --git a/components/libc/compilers/common_all/sys/time.h b/components/libc/compilers/common/all/sys/time.h similarity index 100% rename from components/libc/compilers/common_all/sys/time.h rename to components/libc/compilers/common/all/sys/time.h diff --git a/components/libc/compilers/common_all/termios.h b/components/libc/compilers/common/all/termios.h similarity index 100% rename from components/libc/compilers/common_all/termios.h rename to components/libc/compilers/common/all/termios.h diff --git a/components/libc/compilers/common_all/time.c b/components/libc/compilers/common/all/time.c similarity index 100% rename from components/libc/compilers/common_all/time.c rename to components/libc/compilers/common/all/time.c diff --git a/components/libc/compilers/common_all/unistd.c b/components/libc/compilers/common/all/unistd.c similarity index 100% rename from components/libc/compilers/common_all/unistd.c rename to components/libc/compilers/common/all/unistd.c diff --git a/components/libc/compilers/common_except_gcc/SConscript b/components/libc/compilers/common/excgcc/SConscript similarity index 100% rename from components/libc/compilers/common_except_gcc/SConscript rename to components/libc/compilers/common/excgcc/SConscript diff --git a/components/libc/compilers/common_except_gcc/fcntl.h b/components/libc/compilers/common/excgcc/fcntl.h similarity index 100% rename from components/libc/compilers/common_except_gcc/fcntl.h rename to components/libc/compilers/common/excgcc/fcntl.h diff --git a/components/libc/compilers/common_except_gcc/readme.md b/components/libc/compilers/common/excgcc/readme.md similarity index 100% rename from components/libc/compilers/common_except_gcc/readme.md rename to components/libc/compilers/common/excgcc/readme.md diff --git a/components/libc/compilers/common_except_gcc/sys/stat.h b/components/libc/compilers/common/excgcc/sys/stat.h similarity index 100% rename from components/libc/compilers/common_except_gcc/sys/stat.h rename to components/libc/compilers/common/excgcc/sys/stat.h diff --git a/components/libc/compilers/common_except_gcc/sys/types.h b/components/libc/compilers/common/excgcc/sys/types.h similarity index 100% rename from components/libc/compilers/common_except_gcc/sys/types.h rename to components/libc/compilers/common/excgcc/sys/types.h diff --git a/components/libc/compilers/common_except_gcc/sys/unistd.h b/components/libc/compilers/common/excgcc/sys/unistd.h similarity index 100% rename from components/libc/compilers/common_except_gcc/sys/unistd.h rename to components/libc/compilers/common/excgcc/sys/unistd.h diff --git a/components/libc/compilers/common_except_gcc/unistd.h b/components/libc/compilers/common/excgcc/unistd.h similarity index 100% rename from components/libc/compilers/common_except_gcc/unistd.h rename to components/libc/compilers/common/excgcc/unistd.h diff --git a/include/rtlibc.h b/include/rtlibc.h index 6f6777a2f3..50bddc6ee8 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -23,6 +23,13 @@ #include "libc/libc_limits.h" #include "libc/libc_stdio.h" +#ifndef RT_USING_LIBC +#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) +typedef signed long off_t; +typedef int mode_t; +#endif +#endif + #if defined(__MINGW32__) || defined(_WIN32) typedef signed long off_t; typedef int mode_t;