From 0cc0d250fd3097e4c26b70cdeb5c47caac634069 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 1 Oct 2012 15:12:40 -0700 Subject: [PATCH] Remove useless #defines and incorrect claims from header files. The various __need_* macros were write-only. Change-Id: Id3cca34188e0801fdf93a038b22f2817226ad9c2 --- libc/include/stdio.h | 13 +++---------- libc/include/stdlib.h | 10 ++-------- libc/include/sys/types.h | 5 +---- libc/include/wchar.h | 7 +------ 4 files changed, 7 insertions(+), 28 deletions(-) diff --git a/libc/include/stdio.h b/libc/include/stdio.h index ca7809234..d7c881cb4 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -41,23 +41,16 @@ #include #include -/* va_list and size_t must be defined by stdio.h according to Posix */ -#define __need___va_list #include - -/* note that this forces stddef.h to *only* define size_t */ -#define __need_size_t -#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 long size_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; #endif #ifndef _SSIZE_T_DEFINED_ diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index 9c0e55688..e728cb674 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -30,12 +30,6 @@ #include -/* wchar_t is required in stdlib.h according to POSIX. - * note that defining __need_wchar_t prevents stddef.h - * to define all other symbols it does normally */ -#define __need_wchar_t -#include - #include #include #include @@ -58,8 +52,8 @@ extern int unsetenv(const char *); extern int clearenv(void); extern char *mkdtemp(char *); -extern char *mktemp (char *); -extern int mkstemp (char *); +extern char *mktemp(char *); +extern int mkstemp(char *); extern long strtol(const char *, char **, int); extern long long strtoll(const char *, char **, int); diff --git a/libc/include/sys/types.h b/libc/include/sys/types.h index 33fe30e55..77b32237a 100644 --- a/libc/include/sys/types.h +++ b/libc/include/sys/types.h @@ -28,8 +28,6 @@ #ifndef _SYS_TYPES_H_ #define _SYS_TYPES_H_ -#define __need_size_t -#define __need_ptrdiff_t #include #include #include @@ -45,7 +43,7 @@ typedef __u32 __kernel_dev_t; * these are defined as 16-bit for legacy reason, but * the kernel uses 32-bits instead. * - * 32-bit valuea are required for Android, so use + * 32-bit values are required for Android, so use * __kernel_uid32_t and __kernel_gid32_t */ @@ -90,7 +88,6 @@ typedef .... pthread_t; typedef unsigned int size_t; #endif -/* size_t is defined by the GCC-specific */ #ifndef _SSIZE_T_DEFINED_ #define _SSIZE_T_DEFINED_ typedef long int ssize_t; diff --git a/libc/include/wchar.h b/libc/include/wchar.h index 1361ff530..b46985be3 100644 --- a/libc/include/wchar.h +++ b/libc/include/wchar.h @@ -31,16 +31,11 @@ #include #include -/* wchar_t is required in stdlib.h according to POSIX */ -#define __need___wchar_t -#include - #include +#include #include #include -#include - /* IMPORTANT: Any code that relies on wide character support is essentially * non-portable and/or broken. the only reason this header exist * is because I'm really a nice guy. However, I'm not nice enough