add new intrinsic
[oota-llvm.git] / include / boost / config / posix_features.hpp
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.
5
6 //  See http://www.boost.org for most recent version.
7
8 // All POSIX feature tests go in this file:
9
10 #  ifdef BOOST_HAS_UNISTD_H
11 #     include <unistd.h>
12
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
16 #     endif
17
18       // POSIX version 6 requires <stdint.h>
19 #     if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100)
20 #        define BOOST_HAS_STDINT_H
21 #     endif
22
23       // POSIX defines _POSIX_THREADS > 0 for pthread support,
24       // however some platforms define _POSIX_THREADS without
25       // a value, hence the (_POSIX_THREADS+0 >= 0) check.
26       // Strictly speaking this may catch platforms with a
27       // non-functioning stub <pthreads.h>, but such occurrences should
28       // occur very rarely if at all.
29 #     if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS)
30 #        define BOOST_HAS_PTHREADS
31 #     endif
32
33       // BOOST_HAS_NANOSLEEP:
34       // This is predicated on _POSIX_TIMERS or _XOPEN_REALTIME:
35 #     if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) \
36              || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
37 #        define BOOST_HAS_NANOSLEEP
38 #     endif
39
40       // BOOST_HAS_CLOCK_GETTIME:
41       // This is predicated on _POSIX_TIMERS (also on _XOPEN_REALTIME
42       // but at least one platform - linux - defines that flag without
43       // defining clock_gettime):
44 #     if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0))
45 #        define BOOST_HAS_CLOCK_GETTIME
46 #     endif
47
48       // BOOST_HAS_SCHED_YIELD:
49       // This is predicated on _POSIX_PRIORITY_SCHEDULING or
50       // on _POSIX_THREAD_PRIORITY_SCHEDULING or on _XOPEN_REALTIME.
51 #     if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0)\
52             || (defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0))\
53             || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
54 #        define BOOST_HAS_SCHED_YIELD
55 #     endif
56
57       // BOOST_HAS_GETTIMEOFDAY:
58       // BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE:
59       // These are predicated on _XOPEN_VERSION, and appears to be first released
60       // in issue 4, version 2 (_XOPEN_VERSION > 500).
61 #     if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500)
62 #        define BOOST_HAS_GETTIMEOFDAY
63 #        define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
64 #     endif
65
66 #  endif