Use __ANDROID__ to prepare for upcoming arm_linux_androideabi toolchain.
This patch does not affect current arm-eabi toolchain behavior at all.
It only makes arm_linux_androideabi toolchain to do the same as arm-eabi does.
The current arm_eabi toolchain does not define __unix nor __unix__, so
some statements wrapped by "#if defined (__unix) || defined (__unix__)"
"#endif" won't be included. However, the new arm_linux_androideabi
targets a linux Android platform, where __unix and __unix__ are
defined, which results in the incorrectly inclusion of calls of
IsNANorINF, IsINF, IsNegNAN, ecvt_r, fcvt_r, etc. We need to add
__ANDROID__ to prevent these calls from being included.
As a background, arm_linux_androideabi will be supported by upstream gcc
trunk soon. __ANDROID__ is defined by arm_linux_androideabi toolchain.
Change-Id: I94d3ed2e24b7c25e01ebb5a4dc8d2d568fd09e22
diff --git a/src/num_put_float.cpp b/src/num_put_float.cpp
index cb5c446..e66ae93 100644
--- a/src/num_put_float.cpp
+++ b/src/num_put_float.cpp
@@ -139,7 +139,7 @@
static inline bool _Stl_is_neg_inf(double x) { return isinf(x) && x < 0; }
# elif (defined (__unix) || defined (__unix__)) && \
!defined (__APPLE__) && !defined (__DJGPP) && !defined(__osf__) && \
- !defined (_CRAY)
+ !defined (_CRAY) && !defined (__ANDROID__)
static inline bool _Stl_is_nan_or_inf(double x) { return IsNANorINF(x); }
static inline bool _Stl_is_inf(double x) { return IsNANorINF(x) && IsINF(x); }
static inline bool _Stl_is_neg_inf(double x) { return (IsINF(x)) && (x < 0.0); }
@@ -275,7 +275,8 @@
{ return _ldfcvt(*(long_double*)&x, n, pt, sign); }
# endif
# define _STLP_CVT_NEED_SYNCHRONIZATION
-# elif defined (__unix) && !defined (__APPLE__) && !defined (_CRAY)
+# elif defined (__unix) && !defined (__APPLE__) && !defined (_CRAY) && \
+ !defined (__ANDROID__)
static inline char* _Stl_ecvtR(double x, int n, int* pt, int* sign, char* buf)
{ return ecvt_r(x, n, pt, sign, buf); }
static inline char* _Stl_fcvtR(double x, int n, int* pt, int* sign, char* buf)