sl@0: //  (C) Copyright John Maddock 2001 - 2003. 
sl@0: //  Use, modification and distribution are subject to the 
sl@0: //  Boost Software License, Version 1.0. (See accompanying file 
sl@0: //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
sl@0: 
sl@0: 
sl@0: //  See http://www.boost.org for most recent version.
sl@0: 
sl@0: // All POSIX feature tests go in this file,
sl@0: // Note that we test _POSIX_C_SOURCE and _XOPEN_SOURCE as well
sl@0: // _POSIX_VERSION and _XOPEN_VERSION: on some systems POSIX API's
sl@0: // may be present but none-functional unless _POSIX_C_SOURCE and
sl@0: // _XOPEN_SOURCE have been defined to the right value (it's up
sl@0: // to the user to do this *before* including any header, although
sl@0: // in most cases the compiler will do this for you).
sl@0: 
sl@0: #  if defined(BOOST_HAS_UNISTD_H)
sl@0: #     include <unistd.h>
sl@0: 
sl@0:       // XOpen has <nl_types.h>, but is this the correct version check?
sl@0: #     if defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 3)
sl@0: #        define BOOST_HAS_NL_TYPES_H
sl@0: #     endif
sl@0: 
sl@0:       // POSIX version 6 requires <stdint.h>
sl@0: #     if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100)
sl@0: #        define BOOST_HAS_STDINT_H
sl@0: #     endif
sl@0: 
sl@0:       // POSIX version 2 requires <dirent.h>
sl@0: #     if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199009L)
sl@0: #        define BOOST_HAS_DIRENT_H
sl@0: #     endif
sl@0: 
sl@0:       // POSIX version 3 requires <signal.h> to have sigaction:
sl@0: #     if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199506L)
sl@0: #        define BOOST_HAS_SIGACTION
sl@0: #     endif
sl@0:       // POSIX defines _POSIX_THREADS > 0 for pthread support,
sl@0:       // however some platforms define _POSIX_THREADS without
sl@0:       // a value, hence the (_POSIX_THREADS+0 >= 0) check.
sl@0:       // Strictly speaking this may catch platforms with a
sl@0:       // non-functioning stub <pthreads.h>, but such occurrences should
sl@0:       // occur very rarely if at all.
sl@0: #     if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_MPTASKS)
sl@0: #        define BOOST_HAS_PTHREADS
sl@0: #     endif
sl@0: 
sl@0:       // BOOST_HAS_NANOSLEEP:
sl@0:       // This is predicated on _POSIX_TIMERS or _XOPEN_REALTIME:
sl@0: #     if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) \
sl@0:              || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
sl@0: #        define BOOST_HAS_NANOSLEEP
sl@0: #     endif
sl@0: 
sl@0:       // BOOST_HAS_CLOCK_GETTIME:
sl@0:       // This is predicated on _POSIX_TIMERS (also on _XOPEN_REALTIME
sl@0:       // but at least one platform - linux - defines that flag without
sl@0:       // defining clock_gettime):
sl@0: #     if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0))
sl@0: #        define BOOST_HAS_CLOCK_GETTIME
sl@0: #     endif
sl@0: 
sl@0:       // BOOST_HAS_SCHED_YIELD:
sl@0:       // This is predicated on _POSIX_PRIORITY_SCHEDULING or
sl@0:       // on _POSIX_THREAD_PRIORITY_SCHEDULING or on _XOPEN_REALTIME.
sl@0: #     if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0)\
sl@0:             || (defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0))\
sl@0:             || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
sl@0: #        define BOOST_HAS_SCHED_YIELD
sl@0: #     endif
sl@0: 
sl@0:       // BOOST_HAS_GETTIMEOFDAY:
sl@0:       // BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE:
sl@0:       // These are predicated on _XOPEN_VERSION, and appears to be first released
sl@0:       // in issue 4, version 2 (_XOPEN_VERSION > 500).
sl@0:       // Likewise for the functions log1p and expm1.
sl@0: #     if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500)
sl@0: #        define BOOST_HAS_GETTIMEOFDAY
sl@0: #        if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500)
sl@0: #           define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
sl@0: #        endif
sl@0: #        ifndef BOOST_HAS_LOG1P
sl@0: #           define BOOST_HAS_LOG1P
sl@0: #        endif
sl@0: #        ifndef BOOST_HAS_EXPM1
sl@0: #           define BOOST_HAS_EXPM1
sl@0: #        endif
sl@0: #     endif
sl@0: 
sl@0: #  endif
sl@0: 
sl@0: 
sl@0: 
sl@0: