summaryrefslogtreecommitdiffstats
path: root/9/platforms/android-14/arch-x86/usr/include/sys/cdefs.h
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2013-11-11 15:54:42 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2013-11-11 15:58:28 +0800
commite02e042b38d282df98814709a68d40cbcf614216 (patch)
tree7b4397b72d0afef5d4030209383f2723da918389 /9/platforms/android-14/arch-x86/usr/include/sys/cdefs.h
parent80382fb8411116a733a37ba4f9cc4659427e6894 (diff)
downloadprebuilts_ndk-e02e042b38d282df98814709a68d40cbcf614216.zip
prebuilts_ndk-e02e042b38d282df98814709a68d40cbcf614216.tar.gz
prebuilts_ndk-e02e042b38d282df98814709a68d40cbcf614216.tar.bz2
Refresh prebuilts/ndk/9/platforms with r9b+, part 1/2
Part 1: modify the existing API level Change-Id: Ib14a58f8c1d52d7e5ec95a2f3d64077046c6c0fe
Diffstat (limited to '9/platforms/android-14/arch-x86/usr/include/sys/cdefs.h')
-rw-r--r--9/platforms/android-14/arch-x86/usr/include/sys/cdefs.h27
1 files changed, 27 insertions, 0 deletions
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 <android/api-level.h>
+/* __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_ */