summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorBruce Beare <brucex.j.beare@intel.com>2010-03-10 15:52:42 -0800
committerBruce Beare <brucex.j.beare@intel.com>2010-03-26 09:36:01 -0700
commit58f0326362ca0f5fc17cbc19fd9217cabf0d93dd (patch)
treefd4b6450243770a37214f83ded426cfca3fab259 /libc
parent1825fb5d5f214849e39d95660795a0d3633f8eeb (diff)
downloadbionic-58f0326362ca0f5fc17cbc19fd9217cabf0d93dd.zip
bionic-58f0326362ca0f5fc17cbc19fd9217cabf0d93dd.tar.gz
bionic-58f0326362ca0f5fc17cbc19fd9217cabf0d93dd.tar.bz2
Android hack for size_t
Change-Id: I3c967fca60f542459dc17be84da47b3b6a26242b
Diffstat (limited to 'libc')
-rw-r--r--libc/arch-x86/include/machine/_types.h19
1 files changed, 16 insertions, 3 deletions
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_