From e02e042b38d282df98814709a68d40cbcf614216 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh Date: Mon, 11 Nov 2013 15:54:42 +0800 Subject: Refresh prebuilts/ndk/9/platforms with r9b+, part 1/2 Part 1: modify the existing API level Change-Id: Ib14a58f8c1d52d7e5ec95a2f3d64077046c6c0fe --- .../android-14/arch-x86/usr/include/sys/cdefs.h | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to '9/platforms/android-14/arch-x86/usr/include/sys/cdefs.h') diff --git a/9/platforms/android-14/arch-x86/usr/include/sys/cdefs.h b/9/platforms/android-14/arch-x86/usr/include/sys/cdefs.h index 92035d4..beb35c4 100644 --- a/9/platforms/android-14/arch-x86/usr/include/sys/cdefs.h +++ b/9/platforms/android-14/arch-x86/usr/include/sys/cdefs.h @@ -499,4 +499,31 @@ #define __BIONIC__ 1 #include +/* __NDK_FPABI__ or __NDK_FPABI_MATH__ are applied to APIs taking or returning float or + [long] double, to ensure even at the presence of -mhard-float (which implies + -mfloat-abi=hard), calling to 32-bit Android native APIs still follow -mfloat-abi=softfp. + + __NDK_FPABI_MATH__ is applied to APIs in math.h. It normally equals to __NDK_FPABI__, + but allows use of customized libm.a compiled with -mhard-float by -D_NDK_MATH_NO_SOFTFP=1 + + NOTE: Disable for clang for now unless _NDK_MATH_NO_SOFTFP=1, because clang before 3.4 doesn't + allow change of calling convension for builtin and produces error message reads: + + a.i:564:6: error: function declared 'aapcs' here was previously declared without calling convention + int sin(double d) __attribute__((pcs("aapcs"))); + ^ + a.i:564:6: note: previous declaration is here + */ +#if defined(__ANDROID__) && !__LP64__ && defined( __arm__) +#define __NDK_FPABI__ __attribute__((pcs("aapcs"))) +#else +#define __NDK_FPABI__ +#endif + +#if (!defined(_NDK_MATH_NO_SOFTFP) || _NDK_MATH_NO_SOFTFP != 1) && !defined(__clang__) +#define __NDK_FPABI_MATH__ __NDK_FPABI__ +#else +#define __NDK_FPABI_MATH__ /* nothing */ +#endif + #endif /* !_SYS_CDEFS_H_ */ -- cgit v1.1