From 36f0d5651765ffb653407e6810948f7dc6070604 Mon Sep 17 00:00:00 2001 From: Mark D Horn Date: Wed, 3 Aug 2011 15:11:56 -0700 Subject: [PATCH 1/2] Fix size_t definition in x86 NDK header file Bug: http://code.google.com/p/android/issues/detail?id=19011 The incorrect #define was being used which caused the incorrect definition for size_t when the standalone toolchain is used. Change-Id: Ifef4dc987c542a9c5d8bb43d84d3fe1431de9aa0 Signed-off-by: Mark D Horn --- ndk/platforms/android-9/arch-x86/include/machine/_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndk/platforms/android-9/arch-x86/include/machine/_types.h b/ndk/platforms/android-9/arch-x86/include/machine/_types.h index e9280a5da..5e28c6408 100644 --- a/ndk/platforms/android-9/arch-x86/include/machine/_types.h +++ b/ndk/platforms/android-9/arch-x86/include/machine/_types.h @@ -38,7 +38,7 @@ /* 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 +# ifdef __ANDROID__ typedef unsigned int size_t; # else typedef unsigned long size_t; From f907f4f9d4e56ccc8093df6fee54454b8bcab6c2 Mon Sep 17 00:00:00 2001 From: Mark D Horn Date: Thu, 4 Aug 2011 17:11:15 -0700 Subject: [PATCH 2/2] NDK: x86 header file has incorrect definition for ptrdiff_t See Bug http://code.google.com/p/android/issues/detail?id=19042 Change-Id: Ibee74a22ca8cb1e62b7a6faff01291c6c7a56775 Signed-off-by: Mark D Horn --- ndk/platforms/android-9/arch-x86/include/machine/_types.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ndk/platforms/android-9/arch-x86/include/machine/_types.h b/ndk/platforms/android-9/arch-x86/include/machine/_types.h index 5e28c6408..65892a11e 100644 --- a/ndk/platforms/android-9/arch-x86/include/machine/_types.h +++ b/ndk/platforms/android-9/arch-x86/include/machine/_types.h @@ -51,7 +51,11 @@ typedef long int ssize_t; #endif #ifndef _PTRDIFF_T #define _PTRDIFF_T -typedef long ptrdiff_t; +# ifdef __ANDROID__ + typedef int ptrdiff_t; +# else + typedef long ptrdiff_t; +# endif #endif #include