From b3d872740b7f95c9e2803df298665f31b3f8990f Mon Sep 17 00:00:00 2001 From: bernard Date: Tue, 31 Oct 2017 10:24:11 +0800 Subject: [PATCH] [libc] Fix the typedef in minilibc. --- components/libc/compilers/minilibc/stdint.h | 14 ++++++------- components/libc/compilers/minilibc/sys/time.h | 1 + .../libc/compilers/minilibc/sys/types.h | 20 +++++++++---------- include/libc/libc_fdset.h | 4 ++++ 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/components/libc/compilers/minilibc/stdint.h b/components/libc/compilers/minilibc/stdint.h index af7df16846..8733d60a03 100644 --- a/components/libc/compilers/minilibc/stdint.h +++ b/components/libc/compilers/minilibc/stdint.h @@ -1,14 +1,14 @@ #ifndef __STDINT_H__ #define __STDINT_H__ -#include +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 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 long long int64_t; typedef unsigned long long uint64_t; typedef signed long intptr_t; diff --git a/components/libc/compilers/minilibc/sys/time.h b/components/libc/compilers/minilibc/sys/time.h index ada613251b..9cb330df5c 100644 --- a/components/libc/compilers/minilibc/sys/time.h +++ b/components/libc/compilers/minilibc/sys/time.h @@ -2,6 +2,7 @@ #define _SYS_TIME_H_ #include +typedef long time_t; /* * Structure returned by gettimeofday(2) system call, diff --git a/components/libc/compilers/minilibc/sys/types.h b/components/libc/compilers/minilibc/sys/types.h index a6860f2aee..7f27de468f 100644 --- a/components/libc/compilers/minilibc/sys/types.h +++ b/components/libc/compilers/minilibc/sys/types.h @@ -1,27 +1,25 @@ #ifndef __TYPES_H__ #define __TYPES_H__ -#include +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 + diff --git a/include/libc/libc_fdset.h b/include/libc/libc_fdset.h index 0056d61cc5..613b0e9539 100644 --- a/include/libc/libc_fdset.h +++ b/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;