os/ossrv/ossrv_pub/boost_apis/boost/config/posix_features.hpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
//  (C) Copyright John Maddock 2001 - 2003. 
sl@0
     2
//  Use, modification and distribution are subject to the 
sl@0
     3
//  Boost Software License, Version 1.0. (See accompanying file 
sl@0
     4
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
sl@0
     5
sl@0
     6
sl@0
     7
//  See http://www.boost.org for most recent version.
sl@0
     8
sl@0
     9
// All POSIX feature tests go in this file,
sl@0
    10
// Note that we test _POSIX_C_SOURCE and _XOPEN_SOURCE as well
sl@0
    11
// _POSIX_VERSION and _XOPEN_VERSION: on some systems POSIX API's
sl@0
    12
// may be present but none-functional unless _POSIX_C_SOURCE and
sl@0
    13
// _XOPEN_SOURCE have been defined to the right value (it's up
sl@0
    14
// to the user to do this *before* including any header, although
sl@0
    15
// in most cases the compiler will do this for you).
sl@0
    16
sl@0
    17
#  if defined(BOOST_HAS_UNISTD_H)
sl@0
    18
#     include <unistd.h>
sl@0
    19
sl@0
    20
      // XOpen has <nl_types.h>, but is this the correct version check?
sl@0
    21
#     if defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 3)
sl@0
    22
#        define BOOST_HAS_NL_TYPES_H
sl@0
    23
#     endif
sl@0
    24
sl@0
    25
      // POSIX version 6 requires <stdint.h>
sl@0
    26
#     if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100)
sl@0
    27
#        define BOOST_HAS_STDINT_H
sl@0
    28
#     endif
sl@0
    29
sl@0
    30
      // POSIX version 2 requires <dirent.h>
sl@0
    31
#     if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199009L)
sl@0
    32
#        define BOOST_HAS_DIRENT_H
sl@0
    33
#     endif
sl@0
    34
sl@0
    35
      // POSIX version 3 requires <signal.h> to have sigaction:
sl@0
    36
#     if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199506L)
sl@0
    37
#        define BOOST_HAS_SIGACTION
sl@0
    38
#     endif
sl@0
    39
      // POSIX defines _POSIX_THREADS > 0 for pthread support,
sl@0
    40
      // however some platforms define _POSIX_THREADS without
sl@0
    41
      // a value, hence the (_POSIX_THREADS+0 >= 0) check.
sl@0
    42
      // Strictly speaking this may catch platforms with a
sl@0
    43
      // non-functioning stub <pthreads.h>, but such occurrences should
sl@0
    44
      // occur very rarely if at all.
sl@0
    45
#     if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_MPTASKS)
sl@0
    46
#        define BOOST_HAS_PTHREADS
sl@0
    47
#     endif
sl@0
    48
sl@0
    49
      // BOOST_HAS_NANOSLEEP:
sl@0
    50
      // This is predicated on _POSIX_TIMERS or _XOPEN_REALTIME:
sl@0
    51
#     if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) \
sl@0
    52
             || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
sl@0
    53
#        define BOOST_HAS_NANOSLEEP
sl@0
    54
#     endif
sl@0
    55
sl@0
    56
      // BOOST_HAS_CLOCK_GETTIME:
sl@0
    57
      // This is predicated on _POSIX_TIMERS (also on _XOPEN_REALTIME
sl@0
    58
      // but at least one platform - linux - defines that flag without
sl@0
    59
      // defining clock_gettime):
sl@0
    60
#     if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0))
sl@0
    61
#        define BOOST_HAS_CLOCK_GETTIME
sl@0
    62
#     endif
sl@0
    63
sl@0
    64
      // BOOST_HAS_SCHED_YIELD:
sl@0
    65
      // This is predicated on _POSIX_PRIORITY_SCHEDULING or
sl@0
    66
      // on _POSIX_THREAD_PRIORITY_SCHEDULING or on _XOPEN_REALTIME.
sl@0
    67
#     if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0)\
sl@0
    68
            || (defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0))\
sl@0
    69
            || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
sl@0
    70
#        define BOOST_HAS_SCHED_YIELD
sl@0
    71
#     endif
sl@0
    72
sl@0
    73
      // BOOST_HAS_GETTIMEOFDAY:
sl@0
    74
      // BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE:
sl@0
    75
      // These are predicated on _XOPEN_VERSION, and appears to be first released
sl@0
    76
      // in issue 4, version 2 (_XOPEN_VERSION > 500).
sl@0
    77
      // Likewise for the functions log1p and expm1.
sl@0
    78
#     if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500)
sl@0
    79
#        define BOOST_HAS_GETTIMEOFDAY
sl@0
    80
#        if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500)
sl@0
    81
#           define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
sl@0
    82
#        endif
sl@0
    83
#        ifndef BOOST_HAS_LOG1P
sl@0
    84
#           define BOOST_HAS_LOG1P
sl@0
    85
#        endif
sl@0
    86
#        ifndef BOOST_HAS_EXPM1
sl@0
    87
#           define BOOST_HAS_EXPM1
sl@0
    88
#        endif
sl@0
    89
#     endif
sl@0
    90
sl@0
    91
#  endif
sl@0
    92
sl@0
    93
sl@0
    94
sl@0
    95