Implement generalized table lookups for upper, lower, and character

traits.

To the best of my knowledge, this will not break the ABI for Apple.
However, it does introduce three publicly visible (although with
reserved name) functions that will fail to link against the just-shipped
Apple version of libc++. Since they are not used in any inline
functions, no actual breakage should occur.

If Howard doesn't want to put undefined functions (even internal ones)
into a header, they could be surrounded by additional conditional
compilation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@134781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sean Hunt
2011-07-09 00:56:23 +00:00
parent 043fe1d931
commit 62a6ac33a2
3 changed files with 66 additions and 69 deletions

View File

@@ -302,7 +302,11 @@ locale::operator()(const basic_string<_CharT, _Traits, _Allocator>& __x,
class _LIBCPP_VISIBLE ctype_base
{
public:
#ifdef __GLIBC__
typedef unsigned short mask;
#else
typedef __uint32_t mask;
#endif
#if __APPLE__
static const mask space = _CTYPE_S;
@@ -537,6 +541,8 @@ public:
#endif
_LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;}
static const mask* classic_table() _NOEXCEPT;
static const int* __classic_upper_table() _NOEXCEPT;
static const int* __classic_lower_table() _NOEXCEPT;
protected:
~ctype();

View File

@@ -192,6 +192,9 @@ template <class charT> class messages_byname;
_LIBCPP_BEGIN_NAMESPACE_STD
// Get the C locale object
locale_t __cloc();
// 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
// that's possible and otherwise do the wrong thing. FIXME.