Permalink
Browse files

Merge tag 'android-4.3_r2.1' into cm-10.2

Android 4.3 release 2.1
  • Loading branch information...
2 parents 30865cb + c7253d8 commit 03276356a4c22d112a31ae92342bace366af1681 @rmcc rmcc committed Jul 24, 2013
@@ -44,8 +44,12 @@
static const char *_C_name = "C";
static const char *_empty_str = "";
#ifndef _STLP_NO_WCHAR_T
+#if defined(WCHAR_MAX) && WCHAR_MAX == 255
+static const wchar_t *_empty_wstr = "";
+#else
static const wchar_t *_empty_wstr = L"";
#endif
+#endif
static _Locale_mask_t ctable[256];
@@ -207,14 +211,14 @@ _Locale_mask_t _WLocale_ctype(struct _Locale_ctype *lctype, wint_t wc, _Locale_m
_Locale_mask_t ret = 0;
if ((mask & _Locale_ALPHA) != 0 && iswalpha(wc))
ret |= _Locale_ALPHA;
-
+
if ((mask & _Locale_CNTRL) != 0 && iswcntrl(wc))
ret |= _Locale_CNTRL;
if ((mask & _Locale_DIGIT) != 0 && iswdigit(wc))
ret |= _Locale_DIGIT;
- if ((mask & _Locale_PRINT) != 0 && iswprint(wc))
+ if ((mask & _Locale_PRINT) != 0 && iswprint(wc))
ret |= _Locale_PRINT;
if ((mask & _Locale_PUNCT) != 0 && iswpunct(wc))
@@ -344,11 +348,18 @@ wchar_t _WLocale_decimal_point(struct _Locale_numeric* lnum)
{ return L'.'; }
wchar_t _WLocale_thousands_sep(struct _Locale_numeric* lnum)
{ return L','; }
+#if defined(WCHAR_MAX) && WCHAR_MAX == 255
+const wchar_t * _WLocale_true(struct _Locale_numeric* lnum, wchar_t* buf, size_t bufSize)
+{ return "true"; }
+const wchar_t * _WLocale_false(struct _Locale_numeric* lnum, wchar_t* buf, size_t bufSize)
+{ return "false"; }
+#else
const wchar_t * _WLocale_true(struct _Locale_numeric* lnum, wchar_t* buf, size_t bufSize)
{ return L"true"; }
const wchar_t * _WLocale_false(struct _Locale_numeric* lnum, wchar_t* buf, size_t bufSize)
{ return L"false"; }
#endif
+#endif
/* Monetary */
@@ -441,6 +452,40 @@ const char* _Locale_pm_str(struct _Locale_time* ltime)
{ return "PM"; }
#ifndef _STLP_NO_WCHAR_T
+#if defined(WCHAR_MAX) && WCHAR_MAX == 255
+static const wchar_t* full_wmonthname[] =
+{ "January", "February", "March", "April", "May", "June",
+ "July", "August", "September", "October", "November", "December" };
+const wchar_t * _WLocale_full_monthname(struct _Locale_time * ltime, int n,
+ wchar_t* buf, size_t bufSize)
+{ return full_wmonthname[n]; }
+
+static const wchar_t* abbrev_wmonthname[] =
+{ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+const wchar_t * _WLocale_abbrev_monthname(struct _Locale_time * ltime, int n,
+ wchar_t* buf, size_t bufSize)
+{ return abbrev_wmonthname[n]; }
+
+static const wchar_t* full_wdayname[] =
+{ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
+const wchar_t * _WLocale_full_dayofweek(struct _Locale_time * ltime, int n,
+ wchar_t* buf, size_t bufSize)
+{ return full_wdayname[n]; }
+
+static const wchar_t* abbrev_wdayname[] =
+{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+const wchar_t * _WLocale_abbrev_dayofweek(struct _Locale_time * ltime, int n,
+ wchar_t* buf, size_t bufSize)
+{ return abbrev_wdayname[n]; }
+
+const wchar_t* _WLocale_am_str(struct _Locale_time* ltime,
+ wchar_t* buf, size_t bufSize)
+{ return "AM"; }
+const wchar_t* _WLocale_pm_str(struct _Locale_time* ltime,
+ wchar_t* buf, size_t bufSize)
+{ return "PM"; }
+#else /* WCHAR_MAX != 255 */
static const wchar_t* full_wmonthname[] =
{ L"January", L"February", L"March", L"April", L"May", L"June",
L"July", L"August", L"September", L"October", L"November", L"December" };
@@ -473,6 +518,7 @@ const wchar_t* _WLocale_am_str(struct _Locale_time* ltime,
const wchar_t* _WLocale_pm_str(struct _Locale_time* ltime,
wchar_t* buf, size_t bufSize)
{ return L"PM"; }
+#endif /* WCHAR_MAX != 255 */
#endif
/* Messages */
View
@@ -226,18 +226,24 @@ static complex<_Tp> log10T(const complex<_Tp>& z, const _Tp& ln10_inv) {
return r;
}
-static const float LN10_INVF = 1.f / ::log(10.f);
_STLP_DECLSPEC complex<float> _STLP_CALL log10(const complex<float>& z)
-{ return log10T(z, LN10_INVF); }
+{
+ const float LN10_INVF = 1.f / ::log(10.f);
+ return log10T(z, LN10_INVF);
+}
-static const double LN10_INV = 1. / ::log10(10.);
_STLP_DECLSPEC complex<double> _STLP_CALL log10(const complex<double>& z)
-{ return log10T(z, LN10_INV); }
+{
+ const double LN10_INV = 1. / ::log10(10.);
+ return log10T(z, LN10_INV);
+}
#if !defined (_STLP_NO_LONG_DOUBLE)
-static const long double LN10_INVL = 1.l / ::log(10.l);
_STLP_DECLSPEC complex<long double> _STLP_CALL log10(const complex<long double>& z)
-{ return log10T(z, LN10_INVL); }
+{
+ const long double LN10_INVL = 1.l / ::log(10.l);
+ return log10T(z, LN10_INVL);
+}
#endif
//----------------------------------------------------------------------
View
@@ -42,7 +42,7 @@ _STLP_BEGIN_NAMESPACE
long double ld;
} ldouble_ulimit = {0x408633ce, 0x8fb9f87e, 0xbd23b659, 0x4e9bd8b1};
# if !defined (_STLP_NO_LONG_DOUBLE)
- static const long double ldouble_limit = ldouble_ulimit.ld;
+# define ldouble_limit ldouble_ulimit.ld
# endif
#else
# if defined (M_LN2) && defined (FLT_MAX_EXP)
@@ -54,9 +54,9 @@ _STLP_BEGIN_NAMESPACE
# endif
# if !defined (_STLP_NO_LONG_DOUBLE)
# if defined (M_LN2l)
- static const long double ldouble_limit = M_LN2l * LDBL_MAX_EXP;
+# define ldouble_limit (M_LN2l * LDBL_MAX_EXP)
# else
- static const long double ldouble_limit = ::log(LDBL_MAX);
+# define ldouble_limit ::log(LDBL_MAX)
# endif
# endif
#endif
View
@@ -26,7 +26,8 @@
_STLP_BEGIN_NAMESPACE
-static const string _Nameless("*");
+#define _NAMELESS "*"
+static const char _Nameless[] = _NAMELESS;
static inline bool is_C_locale_name (const char* name)
{ return ((name[0] == 'C') && (name[1] == 0)); }
@@ -248,8 +249,8 @@ locale::locale(const locale& L, const char* name, locale::category c)
if (!name)
_M_throw_on_null_name();
- if (_Nameless == name)
- _STLP_THROW(runtime_error((string("Invalid locale name '") + _Nameless + "'").c_str()));
+ if (!::strcmp(_Nameless, name))
+ _STLP_THROW(runtime_error("Invalid locale name '" _NAMELESS "'"));
_Locale_impl* impl = 0;
View
@@ -28,7 +28,7 @@
_STLP_BEGIN_NAMESPACE
-static const string _Nameless("*");
+static const char _Nameless[] = "*";
static inline bool is_C_locale_name (const char* name)
{ return ((name[0] == 'C') && (name[1] == 0)); }
View
@@ -36,9 +36,9 @@ static void _Init_monetary_formats(money_base::pattern& pos_format,
}
// This is being used throughout the library
-static const string _S_empty_string;
+static const char _S_empty_string[] = "";
#ifndef _STLP_NO_WCHAR_T
-static const wstring _S_empty_wstring;
+static const wchar_t _S_empty_wstring[] = L"";
#endif
//
View
@@ -50,7 +50,7 @@ union _ll {
} i32;
};
-# if defined (__linux__) && !defined (ANDROID)
+# if defined (__linux__) && !defined (__ANDROID__)
# include <ieee754.h>
# else
union ieee854_long_double {
@@ -105,7 +105,7 @@ typedef unsigned __int64 uint64;
# define ULL(x) x##Ui64
#elif defined (__unix) || defined (__MINGW32__) || \
(defined (__DMC__) && (__LONGLONG)) || defined (__WATCOMC__) || \
- defined (ANDROID)
+ defined (__ANDROID__)
typedef uint32_t uint32;
typedef uint64_t uint64;
# define ULL(x) x##ULL
@@ -136,7 +136,7 @@ static void _Stl_mult64(const uint64 u, const uint64 v,
high = u1 * v1 + w2 + (x >> 32);
}
-#if !defined (__linux__) || defined (ANDROID)
+#if !defined (__linux__) || defined (__ANDROID__)
# define bit11 ULL(0x7ff)
# define exponent_mask (bit11 << 52)
@@ -324,7 +324,7 @@ static void _Stl_tenscale(uint64& p, int exp, int& bexp) {
// Third argument is base-10 exponent.
/* IEEE representation */
-#if !defined (__linux__) || defined (ANDROID)
+#if !defined (__linux__) || defined (__ANDROID__)
union _Double_rep {
uint64 ival;
@@ -641,7 +641,7 @@ D _Stl_atodT(char *buffer, ptrdiff_t ndigit, int dexp)
}
#endif // __linux__
-#if !defined (__linux__) || defined (ANDROID)
+#if !defined (__linux__) || defined (__ANDROID__)
static double _Stl_string_to_double(const char *s) {
typedef numeric_limits<double> limits;
const int max_digits = limits::digits10 + 2;
@@ -845,7 +845,7 @@ D _Stl_string_to_doubleT(const char *s)
void _STLP_CALL
__string_to_float(const __iostring& v, float& val)
{
-#if !defined (__linux__) || defined (ANDROID)
+#if !defined (__linux__) || defined (__ANDROID__)
val = (float)_Stl_string_to_double(v.c_str());
#else
val = (float)_Stl_string_to_doubleT<double,ieee754_double,12,IEEE754_DOUBLE_BIAS>(v.c_str());
@@ -855,7 +855,7 @@ __string_to_float(const __iostring& v, float& val)
void _STLP_CALL
__string_to_float(const __iostring& v, double& val)
{
-#if !defined (__linux__) || defined (ANDROID)
+#if !defined (__linux__) || defined (__ANDROID__)
val = _Stl_string_to_double(v.c_str());
#else
val = _Stl_string_to_doubleT<double,ieee754_double,12,IEEE754_DOUBLE_BIAS>(v.c_str());
View
@@ -31,7 +31,7 @@
# if defined (_STLP_IMPORT_VENDOR_CSTD)
_STLP_BEGIN_NAMESPACE
using _STLP_VENDOR_CSTD::lconv;
-# if !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
+# if !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS) && !defined(__ANDROID__)
using _STLP_VENDOR_CSTD::localeconv;
using _STLP_VENDOR_CSTD::setlocale;
# endif
View
@@ -205,7 +205,7 @@ double functions but cast the arguments and return values to the given type. */
/** rough characterization of compiler and native C library
For the compiler, it can either support long double or not. If it doesn't, the
-macro _STLP_NO_LONG_DOUBLE is not defined and we don't define any long double
+macro _STLP_NO_LONG_DOUBLE is defined and we don't define any long double
overloads.
For the native C library the question is whether it has variants with an 'f'
suffix (for float as opposed to double) or an 'l' suffix (for long double). If
@@ -531,7 +531,7 @@ _STLP_DEF_MATH_INLINE2(hypot, _hypot)
#endif
#if defined (_STLP_IMPORT_VENDOR_CSTD) && !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
-#if defined (ANDROID)
+#if defined (__ANDROID__)
namespace __captured {
template<typename _Tp> inline int __capture_isfinite(_Tp __f) { return isfinite(__f); }
template<typename _Tp> inline int __capture_isinf(_Tp __f) { return isinf(__f); }
@@ -573,7 +573,7 @@ using ::frexp;
#if !(defined(__HP_aCC) && defined(_STLP_DEBUG))
using ::hypot;
#endif
-#if defined (ANDROID)
+#if defined (__ANDROID__)
using __captured::isfinite;
using __captured::isinf;
using __captured::isnan;
@@ -583,7 +583,7 @@ using ::log;
using ::log10;
using ::modf;
using ::pow;
-#if defined (ANDROID)
+#if defined (__ANDROID__)
using __captured::signbit;
#endif
using ::sin;
View
@@ -27,7 +27,7 @@
#if defined (_STLP_USE_OWN_MBSTATE_T)
# if !defined (_STLP_CPP_MBSTATE_T) || !defined (__cplusplus) || !defined (_STLP_USE_NEW_C_HEADERS)
-# if !defined (ANDROID) /* mbstate_t conflicts with Android's definition */
+# if !defined (__ANDROID__) /* mbstate_t conflicts with Android's definition */
typedef int mbstate_t;
# endif
# endif
View
@@ -43,7 +43,7 @@
_STLP_BEGIN_NAMESPACE
-#if defined (ANDROID)
+#if defined (__ANDROID__)
/* Android has stl_pair.h, prevent using it by defining the header guard. */
# define __SGI_STL_INTERNAL_PAIR_H
#endif
View
@@ -905,7 +905,9 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
}
reference operator*() {
if (0 == this->_M_buf_ptr)
-#if !defined (__DMC__)
+#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 7))
+ this->_S_setcache(*this);
+#elif !defined (__DMC__)
_S_setcache(*this);
#else
{ _Rope_iterator_base<_CharT, _Alloc>* __x = this; _S_setcache(*__x); }
@@ -59,7 +59,7 @@
# elif defined (__HP_aCC)
# include <stl/config/_hpacc.h>
# endif
-#elif defined (ANDROID)
+#elif defined (__ANDROID__)
/* Android mobile phone platform. Somewhat but not entirely GNU/Linux-like */
# include <stl/config/_android.h>
#elif defined (linux) || defined (__linux__)
@@ -351,7 +351,10 @@ struct _IteWrapper {
_IteWrapper(_Iterator &__ite) : _M_ite(__ite) {}
- const_reference operator*() const { return cast_traits::to_storage_type_cref(*_M_ite); }
+ const_reference operator*() const
+ // See http://code.google.com/p/android/issues/detail?id=38630
+ //{ return cast_traits::to_storage_type_cref(*_M_ite); }
+ { return reinterpret_cast<const_reference>(*_M_ite); }
_Self& operator= (_Self const& __rhs) {
_M_ite = __rhs._M_ite;

0 comments on commit 0327635

Please sign in to comment.