فهرست منبع

增加RT_USING_POSIX_GETLINE用于单独控制是否启用getline函数,并修改Kconfig增加对应选项

mysterywolf 4 سال پیش
والد
کامیت
443978eb78
3فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 6 2
      components/libc/Kconfig
  2. 1 1
      components/libc/getline/SConscript
  3. 1 1
      include/libc/libc_stdio.h

+ 6 - 2
components/libc/Kconfig

@@ -22,11 +22,15 @@ if RT_USING_LIBC && RT_USING_DFS
 
     if RT_USING_POSIX
     config RT_USING_POSIX_MMAP
-        bool "Enable mmap() api"
+        bool "Enable mmap() API"
         default n
 
     config RT_USING_POSIX_TERMIOS
-        bool "Enable termios feature"
+        bool "Enable termios APIs"
+        default n
+
+    config RT_USING_POSIX_GETLINE
+        bool "Enable getline()/getdelim() APIs"
         default n
 
     config RT_USING_POSIX_AIO

+ 1 - 1
components/libc/getline/SConscript

@@ -7,7 +7,7 @@ src = Glob('*.c') + Glob('*.cpp')
 CPPPATH = [cwd]
 
 group = DefineGroup('libc', src, 
-    depend = ['RT_USING_LIBC', 'RT_USING_POSIX'], 
+    depend = ['RT_USING_LIBC', 'RT_USING_POSIX','RT_USING_POSIX_GETLINE'], 
     CPPPATH = CPPPATH)
 
 Return('group')

+ 1 - 1
include/libc/libc_stdio.h

@@ -15,7 +15,7 @@
 #ifndef LIBC_STDIO_H__
 #define LIBC_STDIO_H__
 
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_GETLINE
 
 #include <posix_getline.h>