소스 검색

[libc] Fix the typedef in minilibc.

bernard 7 년 전
부모
커밋
b3d872740b

+ 8 - 8
components/libc/compilers/minilibc/stdint.h

@@ -1,14 +1,14 @@
 #ifndef __STDINT_H__
 #define __STDINT_H__
 
-#include <rtthread.h>
-
-typedef	rt_int8_t		int8_t;
-typedef	rt_uint8_t		uint8_t;
-typedef	rt_int16_t		int16_t;
-typedef	rt_uint16_t		uint16_t;
-typedef	rt_int32_t		int32_t;
-typedef	rt_uint32_t		uint32_t;
+typedef signed char  int8_t;
+typedef signed short int16_t;
+typedef signed int   int32_t;
+
+typedef unsigned char  uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int   uint32_t;
+
 typedef long long		int64_t;
 typedef unsigned long long uint64_t;
 typedef signed long     intptr_t;

+ 1 - 0
components/libc/compilers/minilibc/sys/time.h

@@ -2,6 +2,7 @@
 #define _SYS_TIME_H_
 
 #include <sys/types.h>
+typedef long time_t;
 
 /*
  * Structure returned by gettimeofday(2) system call,

+ 9 - 11
components/libc/compilers/minilibc/sys/types.h

@@ -1,27 +1,25 @@
 #ifndef __TYPES_H__
 #define __TYPES_H__
 
-#include <rtthread.h>
+typedef long        off_t;
+typedef unsigned long size_t;
+typedef signed long   ssize_t;      /* Used for a count of bytes or an error indication. */
 
-typedef long    	off_t;
-typedef __SIZE_TYPE__ 	size_t;
-typedef signed long ssize_t;		/* Used for a count of bytes or an error indication. */
+typedef unsigned char  u_char;
+typedef unsigned short u_short;
+typedef unsigned int   u_int;
+typedef unsigned long  u_long;
 
-typedef rt_uint8_t 	u_char;
-typedef rt_uint16_t u_short;
-typedef rt_ubase_t 	u_int;
-typedef rt_uint32_t u_long;
-
-typedef rt_time_t time_t;
 typedef int mode_t;
 
 typedef unsigned long clockid_t;
 typedef int pid_t;
 
 #ifndef NULL
-#define NULL RT_NULL
+#define NULL        (0)
 #endif
 
 #define __u_char_defined
 
 #endif
+

+ 4 - 0
include/libc/libc_fdset.h

@@ -40,6 +40,10 @@
 #define FD_SETSIZE      DFS_FD_MAX
 #endif
 
+#  ifndef	FD_SETSIZE
+#	define	FD_SETSIZE	32
+#  endif
+
 #  define	NBBY	8		/* number of bits in a byte */
 
 typedef	long	fd_mask;