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

Dan Albert danalbert at google.com
Wed Sep 17 11:27:57 PDT 2014


================
Comment at: include/locale:197
@@ +196,3 @@
+#define __has_include(x) 0
+#endif
+#if __has_include(<newlib.h>)
----------------
jfb wrote:
> This is only done in `.cpp` files, putting it here means it leaks to users.
newlib's sys/cdefs.h seems to do this anyway. Talking with jroelofs on IRC, he's going to see if we can skip this check by changing newlib's sys/cdefs.h to #define some way to identify as newlib (that's where other libcs provide such a definition).

================
Comment at: include/support/newlib/xlocale.h:36
@@ +35,3 @@
+static inline locale_t duplocale(locale_t) {
+  return nullptr;
+}
----------------
Can't use nullptr here (need to be able to include from pre-C++11 code).

http://reviews.llvm.org/D5385






More information about the cfe-commits mailing list