[v3] libstdc++/49745 (review required for the gthr-posix.h changes)

Paolo Carlini paolo.carlini@oracle.com
Fri Jul 15 15:06:00 GMT 2011


Hi,
> gthr-posix.h already uses other macros defined by other library
> headers, like _LIBOBJC.  gthr-posix-conf.h looks like an overkill to me,
> but if e.g. libstdc++ headers defined a 0/1 macro always
> (_GTHREAD_USE_TIMEDLOCK 0 would mean don't define it, _GTHREAD_USE_TIMEDLOCK 1
> would mean you can safely assume timedlock is available, and not presence
> of that macro would lead to inclusion of unistd.h and deciding itself
> based on _POSIX_TIMEOUTS:
>
> #ifndef _GTHREAD_USE_TIMEDLOCK
> #include<unistd.h>
> #ifdef _POSIX_TIMEOUTS
> #if _POSIX_TIMEOUTS>= 0
> #define _GTHREAD_USE_TIMEDLOCK 1
> #else
> #define _GTHREAD_USE_TIMEDLOCK 0
> #else
> #define _GTHREAD_USE_TIMEDLOCK 0
> #endif
> and use
>
> #if _GTHREAD_USE_TIMEDLOCK
> ...
> #endif
>
I'm finishing testing the below. Appears to work well, so far...

Paolo.

////////////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_49745_2
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20110715/87b0ac4c/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_49745_2
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20110715/87b0ac4c/attachment-0001.ksh>


More information about the Libstdc++ mailing list