The answer from the Austin Group list was that the POSIX requirement
*does* mean all symbols from time.h are to be defined by pthread.h and
it's a bug in the change history that it refers to allowing rather
than requiring the symbols to be made visible.  Thus, I propose this
patch to make pthread.h define all symbols from time.h again, so that
NULL is defined and libstdc++ can build again.  (Given that the POSIX
change resulted from an interpretation request I think we don't need
to make this conditional on the version of POSIX selected but can
treat the omission of this requirement / permission as a defect in
older POSIX versions.)

Tested x86_64.

2012-03-09  Joseph Myers  <jos...@codesourcery.com>

        * sysdeps/pthread/pthread.h (__need_clockid_t, __need_timespec):
        Do not define before including <time.h>.

diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index 0d33cbd..bd97e85 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -21,10 +21,6 @@
 #include <features.h>
 #include <endian.h>
 #include <sched.h>
-#ifdef __USE_XOPEN2K
-# define __need_clockid_t
-#endif
-#define __need_timespec
 #include <time.h>
 
 #include <bits/pthreadtypes.h>

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to