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

JF Bastien jfb at chromium.org
Wed Sep 17 15:05:53 PDT 2014


================
Comment at: include/locale:197
@@ +196,3 @@
+#define __has_include(x) 0
+#endif
+#if __has_include(<newlib.h>)
----------------
jroelofs wrote:
> danalbert wrote:
> > 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).
> Discussion with newlib folks suggests that this check and include isn't necessary at all as ctime includes time.h which includes _ansi.h, which includes newlib.h.  They might be convinced to add __NEWLIB__ to sys/cdefs.h, but until then, we can get by with dropping this part of the patch.
The thread:
  https://sourceware.org/ml/newlib/2014/msg00455.html

This sounds good to me, though it might be an issue in headers where we try to minimize the number/size of headers included (locale is OK, but others may need `_NEWLIB_VERSION` and have to have an extra include until the newlib fix comes).

http://reviews.llvm.org/D5385






More information about the cfe-commits mailing list