1 // (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
2 // distribute this software is granted provided this copyright notice appears
3 // in all copies. This software is provided "as is" without express or implied
4 // warranty, and with no claim as to its suitability for any purpose.
6 // See http://www.boost.org for most recent version.
8 // All POSIX feature tests go in this file:
10 # ifdef BOOST_HAS_UNISTD_H
13 // XOpen has <nl_types.h>, but is this the correct version check?
14 # if defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 3)
15 # define BOOST_HAS_NL_TYPES_H
18 // POSIX version 6 requires <stdint.h>
19 # if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100)
20 # define BOOST_HAS_STDINT_H
23 // POSIX version 2 requires <dirent.h>
24 # if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199009L)
25 # define BOOST_HAS_DIRENT_H
28 // POSIX defines _POSIX_THREADS > 0 for pthread support,
29 // however some platforms define _POSIX_THREADS without
30 // a value, hence the (_POSIX_THREADS+0 >= 0) check.
31 // Strictly speaking this may catch platforms with a
32 // non-functioning stub <pthreads.h>, but such occurrences should
33 // occur very rarely if at all.
34 # if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS)
35 # define BOOST_HAS_PTHREADS
38 // BOOST_HAS_NANOSLEEP:
39 // This is predicated on _POSIX_TIMERS or _XOPEN_REALTIME:
40 # if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) \
41 || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
42 # define BOOST_HAS_NANOSLEEP
45 // BOOST_HAS_CLOCK_GETTIME:
46 // This is predicated on _POSIX_TIMERS (also on _XOPEN_REALTIME
47 // but at least one platform - linux - defines that flag without
48 // defining clock_gettime):
49 # if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0))
50 # define BOOST_HAS_CLOCK_GETTIME
53 // BOOST_HAS_SCHED_YIELD:
54 // This is predicated on _POSIX_PRIORITY_SCHEDULING or
55 // on _POSIX_THREAD_PRIORITY_SCHEDULING or on _XOPEN_REALTIME.
56 # if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0)\
57 || (defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0))\
58 || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
59 # define BOOST_HAS_SCHED_YIELD
62 // BOOST_HAS_GETTIMEOFDAY:
63 // BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE:
64 // These are predicated on _XOPEN_VERSION, and appears to be first released
65 // in issue 4, version 2 (_XOPEN_VERSION > 500).
66 # if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500)
67 # define BOOST_HAS_GETTIMEOFDAY
68 # define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE