[PATCH] [libc++] Support newlib as libc++'s C library [locale part]

Jonathan Roelofs jonathan at codesourcery.com
Wed Sep 17 15:24:16 PDT 2014


================
Comment at: include/locale:195
@@ +194,3 @@
+
+// TODO: Need to fix newlib so that it defines _NEWLIB_VERSION in <sys/cdefs.h>,
+// and not use __has_include here
----------------
Upstream Newlib fixed this in https://sourceware.org/ml/newlib-cvs/2014-q3/msg00038.html

================
Comment at: include/support/newlib/xlocale.h:27
@@ +26,3 @@
+// duck under that velvet rope.
+int isascii(int c);
+
----------------
jfb wrote:
> `isascii` ins't in C++11 either :-)
> 
> Should libc++ not use it at all, or use a special `__isascii`?
Not using it would mean lots of ugly newlib specific stuff in locale.cpp and __locale. Sounds like `inline int __isascii(int c) { int isascii(int); return isascii(c); }` is the way to go here.

================
Comment at: include/support/newlib/xlocale.h:59
@@ +58,3 @@
+
+// Share implementaiton with android bionic
+#include <support/xlocale/xlocale.h>
----------------
jfb wrote:
> typo
good catch

http://reviews.llvm.org/D5385






More information about the cfe-commits mailing list