From 3975cec694a0c9b42e3f7e671fcd678da92836c3 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 29 Nov 2012 17:25:23 -0800 Subject: [PATCH] Remove (near-)duplicate definitions of size_t and ssize_t. The near duplicates upset fussier compilers that insist that typedefs be exactly the same, but the fix isn't to make all copies identical... Change-Id: Icfdace41726f36ec33c9ae919dbb5a54d3529cc9 --- libc/arch-arm/include/machine/_types.h | 11 ----------- libc/arch-mips/include/machine/_types.h | 2 -- libc/arch-x86/include/machine/_types.h | 23 ----------------------- libc/include/search.h | 7 ------- libc/include/stdint.h | 6 ------ libc/include/stdio.h | 21 +-------------------- libc/include/sys/types.h | 5 ----- 7 files changed, 1 insertion(+), 74 deletions(-) diff --git a/libc/arch-arm/include/machine/_types.h b/libc/arch-arm/include/machine/_types.h index dbc4e9d74..1521a4c6c 100644 --- a/libc/arch-arm/include/machine/_types.h +++ b/libc/arch-arm/include/machine/_types.h @@ -35,17 +35,6 @@ #ifndef _ARM__TYPES_H_ #define _ARM__TYPES_H_ - -#if !defined(__ARM_EABI__) -/* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */ -#define _SIZE_T -#define _SSIZE_T -#define _PTRDIFF_T -typedef unsigned long size_t; -typedef long ssize_t; -typedef long ptrdiff_t; -#endif - /* 7.18.1.1 Exact-width integer types */ typedef __signed char __int8_t; typedef unsigned char __uint8_t; diff --git a/libc/arch-mips/include/machine/_types.h b/libc/arch-mips/include/machine/_types.h index 52ccdffb4..05f79ef67 100644 --- a/libc/arch-mips/include/machine/_types.h +++ b/libc/arch-mips/include/machine/_types.h @@ -105,8 +105,6 @@ typedef double __double_t; typedef float __float_t; typedef long long __off_t; typedef long __ptrdiff_t; -/*typedef unsigned long __size_t;*/ -typedef long __ssize_t; typedef int __time_t; typedef int __timer_t; #if defined(__GNUC__) && __GNUC__ >= 3 diff --git a/libc/arch-x86/include/machine/_types.h b/libc/arch-x86/include/machine/_types.h index d3d9eeb6a..d21782284 100644 --- a/libc/arch-x86/include/machine/_types.h +++ b/libc/arch-x86/include/machine/_types.h @@ -35,29 +35,6 @@ #ifndef _I386__TYPES_H_ #define _I386__TYPES_H_ -/* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */ -#ifndef _SIZE_T_DEFINED_ -# define _SIZE_T_DEFINED_ -# ifdef __ANDROID__ - typedef unsigned int size_t; -# else - typedef unsigned long size_t; -# endif -#endif -#if !defined(_SSIZE_T) && !defined(_SSIZE_T_DEFINED_) -#define _SSIZE_T -#define _SSIZE_T_DEFINED_ -typedef long int ssize_t; -#endif -#ifndef _PTRDIFF_T -#define _PTRDIFF_T -# ifdef __ANDROID__ - typedef int ptrdiff_t; -# else - typedef long ptrdiff_t; -# endif -#endif - /* 7.18.1.1 Exact-width integer types */ typedef __signed char __int8_t; typedef unsigned char __uint8_t; diff --git a/libc/include/search.h b/libc/include/search.h index ed0d216c3..e12e49e51 100644 --- a/libc/include/search.h +++ b/libc/include/search.h @@ -12,13 +12,6 @@ #include #include -#if 0 -#ifndef _SIZE_T_DECLARED -typedef __size_t size_t; -#define _SIZE_T_DECLARED -#endif -#endif - typedef enum { preorder, postorder, diff --git a/libc/include/stdint.h b/libc/include/stdint.h index 49879cb5b..c3e29dde7 100644 --- a/libc/include/stdint.h +++ b/libc/include/stdint.h @@ -226,12 +226,6 @@ typedef int64_t intmax_t; # define UINTMAX_C(c) UINT64_C(c) #endif -/* size_t is defined by the GCC-specific */ -#ifndef _SSIZE_T_DEFINED_ -#define _SSIZE_T_DEFINED_ -typedef long int ssize_t; -#endif - #define _BITSIZE 32 /* Keep the kernel from trying to define these types... */ diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 20a982965..cd04d9cbe 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -39,30 +39,11 @@ #define _STDIO_H_ #include -#include +#include #include #include -#if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE -#include /* XXX should be removed */ -#endif - -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif - -#ifndef _SSIZE_T_DEFINED_ -#define _SSIZE_T_DEFINED_ -typedef long int ssize_t; -#endif - -#ifndef _OFF_T_DEFINED_ -#define _OFF_T_DEFINED_ -typedef long off_t; -#endif - #define __need_NULL #include diff --git a/libc/include/sys/types.h b/libc/include/sys/types.h index 77b32237a..8cfeeb69d 100644 --- a/libc/include/sys/types.h +++ b/libc/include/sys/types.h @@ -83,11 +83,6 @@ typedef .... pthread_rwlock_attr_t; typedef .... pthread_t; #endif -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif - #ifndef _SSIZE_T_DEFINED_ #define _SSIZE_T_DEFINED_ typedef long int ssize_t; -- 2.11.0