Conditionally wrap the changes from r134781.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134783 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
62a6ac33a2
commit
e59f724f79
@ -285,4 +285,8 @@ template <unsigned> struct __static_assert_check {};
|
|||||||
#define __has_feature(__x) 0
|
#define __has_feature(__x) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#define _LIBCPP_STABLE_APPLE_ABI
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // _LIBCPP_CONFIG
|
#endif // _LIBCPP_CONFIG
|
||||||
|
@ -541,8 +541,10 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
_LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;}
|
_LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;}
|
||||||
static const mask* classic_table() _NOEXCEPT;
|
static const mask* classic_table() _NOEXCEPT;
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
static const int* __classic_upper_table() _NOEXCEPT;
|
static const int* __classic_upper_table() _NOEXCEPT;
|
||||||
static const int* __classic_lower_table() _NOEXCEPT;
|
static const int* __classic_lower_table() _NOEXCEPT;
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~ctype();
|
~ctype();
|
||||||
|
@ -192,8 +192,10 @@ template <class charT> class messages_byname;
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
// Get the C locale object
|
// Get the C locale object
|
||||||
locale_t __cloc();
|
locale_t __cloc();
|
||||||
|
#endif
|
||||||
|
|
||||||
// OSX has nice foo_l() functions that let you turn off use of the global
|
// OSX has nice foo_l() functions that let you turn off use of the global
|
||||||
// locale. Linux, not so much. The following functions avoid the locale when
|
// locale. Linux, not so much. The following functions avoid the locale when
|
||||||
|
@ -116,6 +116,7 @@ namespace with_locale { namespace {
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
|
#ifndef _LIBCPP_APPLE_STABLE_ABI
|
||||||
locale_t __cloc() {
|
locale_t __cloc() {
|
||||||
// In theory this could create a race condition. In practice
|
// In theory this could create a race condition. In practice
|
||||||
// the race condition is non-fatal since it will just create
|
// the race condition is non-fatal since it will just create
|
||||||
@ -127,6 +128,7 @@ locale_t __cloc() {
|
|||||||
return result;
|
return result;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif // _LIBCPP_APPLE_STABLE_ABI
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@ -812,30 +814,46 @@ ctype<wchar_t>::do_scan_not(mask m, const char_type* low, const char_type* high)
|
|||||||
wchar_t
|
wchar_t
|
||||||
ctype<wchar_t>::do_toupper(char_type c) const
|
ctype<wchar_t>::do_toupper(char_type c) const
|
||||||
{
|
{
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
return isascii(c) ? ctype<char>::__classic_upper_table()[c] : c;
|
return isascii(c) ? ctype<char>::__classic_upper_table()[c] : c;
|
||||||
|
#else
|
||||||
|
return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const wchar_t*
|
const wchar_t*
|
||||||
ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const
|
ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const
|
||||||
{
|
{
|
||||||
for (; low != high; ++low)
|
for (; low != high; ++low)
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
*low = isascii(*low) ? ctype<char>::__classic_upper_table()[*low]
|
*low = isascii(*low) ? ctype<char>::__classic_upper_table()[*low]
|
||||||
: *low;
|
: *low;
|
||||||
|
#else
|
||||||
|
*low = isascii(*low) ? _DefaultRuneLocale.__mapupper[*low] : *low;
|
||||||
|
#endif
|
||||||
return low;
|
return low;
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar_t
|
wchar_t
|
||||||
ctype<wchar_t>::do_tolower(char_type c) const
|
ctype<wchar_t>::do_tolower(char_type c) const
|
||||||
{
|
{
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
return isascii(c) ? ctype<char>::__classic_lower_table()[c] : c;
|
return isascii(c) ? ctype<char>::__classic_lower_table()[c] : c;
|
||||||
|
#else
|
||||||
|
return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const wchar_t*
|
const wchar_t*
|
||||||
ctype<wchar_t>::do_tolower(char_type* low, const char_type* high) const
|
ctype<wchar_t>::do_tolower(char_type* low, const char_type* high) const
|
||||||
{
|
{
|
||||||
for (; low != high; ++low)
|
for (; low != high; ++low)
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
*low = isascii(*low) ? ctype<char>::__classic_lower_table()[*low]
|
*low = isascii(*low) ? ctype<char>::__classic_lower_table()[*low]
|
||||||
: *low;
|
: *low;
|
||||||
|
#else
|
||||||
|
*low = isascii(*low) ? _DefaultRuneLocale.__maplower[*low] : *low;
|
||||||
|
#endif
|
||||||
return low;
|
return low;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -894,28 +912,44 @@ ctype<char>::~ctype()
|
|||||||
char
|
char
|
||||||
ctype<char>::do_toupper(char_type c) const
|
ctype<char>::do_toupper(char_type c) const
|
||||||
{
|
{
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
return isascii(c) ? __classic_upper_table()[c] : c;
|
return isascii(c) ? __classic_upper_table()[c] : c;
|
||||||
|
#else
|
||||||
|
return isascii(c) ? _DefaultRuneLocale.__mapupper[c] : c;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
ctype<char>::do_toupper(char_type* low, const char_type* high) const
|
ctype<char>::do_toupper(char_type* low, const char_type* high) const
|
||||||
{
|
{
|
||||||
for (; low != high; ++low)
|
for (; low != high; ++low)
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
*low = isascii(*low) ? __classic_upper_table()[*low] : *low;
|
*low = isascii(*low) ? __classic_upper_table()[*low] : *low;
|
||||||
|
#else
|
||||||
|
*low = isascii(*low) ? _DefaultRuneLocale.__mapupper[c] : c;
|
||||||
|
#endif
|
||||||
return low;
|
return low;
|
||||||
}
|
}
|
||||||
|
|
||||||
char
|
char
|
||||||
ctype<char>::do_tolower(char_type c) const
|
ctype<char>::do_tolower(char_type c) const
|
||||||
{
|
{
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
return isascii(c) ? __classic_lower_table()[c] : c;
|
return isascii(c) ? __classic_lower_table()[c] : c;
|
||||||
|
#else
|
||||||
|
return isascii(c) ? _DefaultRuneLocale.__maplower[c] : c;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
ctype<char>::do_tolower(char_type* low, const char_type* high) const
|
ctype<char>::do_tolower(char_type* low, const char_type* high) const
|
||||||
{
|
{
|
||||||
for (; low != high; ++low)
|
for (; low != high; ++low)
|
||||||
|
#ifndef _LIBCPP_STABLE_APPLE_ABI
|
||||||
*low = isascii(*low) ? __classic_lower_table()[*low] : *low;
|
*low = isascii(*low) ? __classic_lower_table()[*low] : *low;
|
||||||
|
#else
|
||||||
|
*low = isascii(*low) ? _DefaultRuneLocale.__maplower[c] : c;
|
||||||
|
#endif
|
||||||
return low;
|
return low;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -965,6 +999,7 @@ ctype<char>::classic_table() _NOEXCEPT
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _LIBCPP_APPLE_STABLE_ABI
|
||||||
const int*
|
const int*
|
||||||
ctype<char>::__classic_lower_table() _NOEXCEPT
|
ctype<char>::__classic_lower_table() _NOEXCEPT
|
||||||
{
|
{
|
||||||
@ -988,6 +1023,7 @@ ctype<char>::__classic_upper_table() _NOEXCEPT
|
|||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif // _LIBCPP_APPLE_STABLE_ABI
|
||||||
|
|
||||||
// template <> class ctype_byname<char>
|
// template <> class ctype_byname<char>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user