[libc++ patch] Don't define __need_FOO in cstddef

Nico Weber thakis at chromium.org
Tue May 13 03:00:49 PDT 2014


Hi,

r207606 changed the __need_foo macros to behave like they do with gcc: If
they are set, _only_ the __need_foo stuff gets defined. libc++'s cstddef
sets a few __need_foo settings, so cstddef now doesn't work right with
libc++ after clang r207606.

The attached patch removes the __need_foo defines from libc++'s cstddef.
They were added with a cryptic commit message ""for ubuntu" years ago – I
think they're incorrect, and things still seem to work without them.
(libstdc++ doesn't set them either.) Maybe they were needed before clang
had r207606 – if so, this patch should also improve how libc++ works when
built with gcc.

This fixes PR19723, see the bug for some more information and discussion.

Ok?

Nico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140513/d718b697/attachment.html>
-------------- next part --------------
Index: include/cstddef
===================================================================
--- include/cstddef	(revision 208680)
+++ include/cstddef	(working copy)
@@ -35,12 +35,6 @@
 
 #include <__config>
 
-#ifdef __GLIBC__
-#define __need_NULL
-#define __need_ptrdiff_t
-#define __need_size_t
-#endif  // __GLIBC__
-
 #include <stddef.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)


More information about the cfe-commits mailing list