From 58f0326362ca0f5fc17cbc19fd9217cabf0d93dd Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Wed, 10 Mar 2010 15:52:42 -0800 Subject: Android hack for size_t Change-Id: I3c967fca60f542459dc17be84da47b3b6a26242b --- libc/arch-x86/include/machine/_types.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'libc') diff --git a/libc/arch-x86/include/machine/_types.h b/libc/arch-x86/include/machine/_types.h index 3a31e22..be4f6e4 100644 --- a/libc/arch-x86/include/machine/_types.h +++ b/libc/arch-x86/include/machine/_types.h @@ -36,10 +36,23 @@ #define _I386__TYPES_H_ /* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */ -#define _SIZE_T +#ifndef _SIZE_T +# define _SIZE_T +# 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 -typedef unsigned int size_t; -typedef int ptrdiff_t; +typedef long ptrdiff_t; +#endif #define _OFF_T_DEFINED_ #define _SIZE_T_DEFINED_ -- cgit v1.1