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