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

Jonathan Roelofs jonathan at codesourcery.com
Wed Sep 17 15:02:08 PDT 2014


================
Comment at: include/locale:197
@@ +196,3 @@
+#define __has_include(x) 0
+#endif
+#if __has_include(<newlib.h>)
----------------
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.

http://reviews.llvm.org/D5385






More information about the cfe-commits mailing list