[Bug libstdc++/54847] --enable-libstdcxx-time=yes doesn't find the functional nanosleep() on darwin

howarth at nitro dot med.uc.edu gcc-bugzilla@gcc.gnu.org
Mon Oct 8 16:31:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54847

--- Comment #35 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-10-08 16:31:11 UTC ---
(In reply to comment #33)

> The problem isn't finding nanosleep, it's finding what version of POSIX or
> X/Open or SUS is supported, so we know what the correct feature test macros is
> for nanosleep.
> 
> Is _XOPEN_REALTIME defined?  If so, to what value?
> What about _XOPEN_VERSION and _POSIX_C_VERSION?
> 
> Maybe we can find some other combination of feature test macros that indicate
> the POSIX Realtime extensions (POSIX.1b) are supported.

On darwin12, unistd.h shows...

#define _XOPEN_VERSION                  600             /* [XSI] */

#if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */
...
#define _XOPEN_REALTIME                 (-1)    /* no q'ed signals, mq_* */
#define _XOPEN_REALTIME_THREADS         (-1)    /* no posix_spawn, et. al. */
...
#endif /* XSI */

#if __DARWIN_C_LEVEL >= 199506L /* Really XSI */
...
#define _SC_XOPEN_REALTIME              111      /* Issue 6 */
#define _SC_XOPEN_REALTIME_THREADS      112  /* Issue 6 */
...
#define _SC_XOPEN_VERSION               116
....
#endif /* XSI */

/* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */

while sys/unistd.h doesn't have  _POSIX_C_VERSION but it does have 

#define _POSIX_VERSION          200112L
#define _POSIX2_VERSION         200112L



More information about the Gcc-bugs mailing list