summaryrefslogtreecommitdiffstats
path: root/libcxx/src
diff options
context:
space:
mode:
authorJF Bastien <jfb@google.com>2015-02-25 22:16:46 +0000
committerJF Bastien <jfb@google.com>2015-02-25 22:16:46 +0000
commite9401f61c26689c3029090dd4c4d8469c61d598e (patch)
treea0d78096d0b1556f75dab560ae1df45dc6bff180 /libcxx/src
parent6801be33545e2d6721a44da19b0127a3c3d5b1d5 (diff)
downloadbcm5719-llvm-e9401f61c26689c3029090dd4c4d8469c61d598e.tar.gz
bcm5719-llvm-e9401f61c26689c3029090dd4c4d8469c61d598e.zip
libc++: support newlib's ctype
Summary: Newlib supports ctype differently from other platforms, this patch teaches libc++ about yet another platform that does ctype differently. Reviewers: jroelofs Subscribers: cfe-commits, danalbert, EricWF, jvoung, jfb, mclow.lists Differential Revision: http://reviews.llvm.org/D7888 llvm-svn: 230557
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/locale.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index f21e35dd540..83052f605a6 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -1033,6 +1033,9 @@ ctype<char>::classic_table() _NOEXCEPT
// going to end up dereferencing it later...
#elif defined(__EMSCRIPTEN__)
return *__ctype_b_loc();
+#elif defined(_NEWLIB_VERSION)
+ // Newlib has a 257-entry table in ctype_.c, where (char)0 starts at [1].
+ return _ctype_ + 1;
#elif defined(_AIX)
return (const unsigned int *)__lc_ctype_ptr->obj->mask;
#elif defined(__ANDROID__)
OpenPOWER on IntegriCloud