summaryrefslogtreecommitdiff
path: root/ACE/ace/config-posix.h
blob: 655194e098ecfd3da532682d9fdb9ddbba223a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/* -*- C++ -*- */
#ifndef ACE_CONFIG_POSIX_H
#define ACE_CONFIG_POSIX_H

#include <unistd.h>

/*  The following POSIX constants are defined after <unistd.h> is
 *  included.  They are documented in:
 * http://www.opengroup.org/onlinepubs/007904975/basedefs/unistd.h.html
 */
#if defined(_POSIX_REALTIME_SIGNALS) && (_POSIX_REALTIME_SIGNALS-0 != -1 )
# if !defined(ACE_HAS_POSIX_REALTIME_SIGNALS)
#  define ACE_HAS_POSIX_REALTIME_SIGNALS
# endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */
#endif /* _POSIX_REALTIME_SIGNALS */

#if defined(_POSIX_ASYNCHRONOUS_IO) && (_POSIX_ASYNCHRONOUS_IO-0 != -1 )
# if !defined(ACE_HAS_AIO_CALLS)
#  define ACE_HAS_AIO_CALLS
# endif /* ACE_HAS_AIO_CALLS */
#endif /* _POSIX_ASYNCHRONOUS_IO */

#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE != 0)
# if defined(_POSIX_SEMAPHORES) && (_POSIX_SEMAPHORES-0 != -1 )
#  if !defined(ACE_HAS_POSIX_SEM)
#   define ACE_HAS_POSIX_SEM
#  endif /* ACE_HAS_POSIX_SEM */
#  if defined(ACE_HAS_POSIX_SEM)
#   if !defined (ACE_HAS_POSIX_SEM_TIMEOUT) && \
       (defined (_POSIX_TIMEOUTS) && (_POSIX_TIMEOUTS-0 != -1))
#     define ACE_HAS_POSIX_SEM_TIMEOUT
#   endif /* ACE_HAS_POSIX_SEM_TIMEOUT && _POSIX_TIMEOUTS */
#  endif /* ACE_HAS_POSIX_SEM */
# endif /* ACE_HAS_POSIX_SEM */
#endif /* !ACE_MT_SAFE */

#if defined(_POSIX_SHARED_MEMORY_OBJECTS) && (_POSIX_SHARED_MEMORY_OBJECTS-0 != -1 )
# if !defined(ACE_HAS_SHM_OPEN)
#  define ACE_HAS_SHM_OPEN
# endif /* ACE_HAS_SHM_OPEN */
#endif /* _POSIX_SHARED_MEMORY_OBJECTS */

// Check if threading enabled/disable through platform_macros
#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE != 0)
// Allow the user to disable use of threads by setting ACE_HAS_THREADS to 0
// before including this file. The platform config (not macros) file can
// often detect that the compiler was invoked with or without threads support
// and set this accordingly.
# if defined (ACE_HAS_THREADS) && (ACE_HAS_THREADS == 0)
#   undef ACE_HAS_THREADS
# else
#   if defined(_POSIX_THREADS) && (_POSIX_THREADS-0 != -1 )
#     if !defined(ACE_HAS_THREADS)
#       define ACE_HAS_THREADS
#     endif /* ACE_HAS_THREADS */

#     if !defined(ACE_HAS_PTHREADS)
#       define ACE_HAS_PTHREADS
#     endif /* ACE_HAS_PTHREADS */

#     if defined (_POSIX_CLOCK_SELECTION) && (_POSIX_CLOCK_SELECTION-0 != -1)
#       if !defined (ACE_HAS_CONDATTR_SETCLOCK) && !defined (ACE_LACKS_CONDATTR_SETCLOCK)
#         define ACE_HAS_CONDATTR_SETCLOCK
#       endif
#     endif
#   endif /* _POSIX_THREADS */
# endif /* ACE_HAS_THREADS */
#endif /* !ACE_MT_SAFE */

#if defined(_POSIX_MESSAGE_PASSING) && (_POSIX_MESSAGE_PASSING-0 != -1 )
# if !defined(ACE_HAS_POSIX_MESSAGE_PASSING)
#  define ACE_HAS_POSIX_MESSAGE_PASSING
# endif /* ACE_HAS_POSIX_MESSAGE_PASSING */
#endif /* _POSIX_MESSAGE_PASSING */

#if defined (_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 != -1)
#  if !defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC) && !defined (ACE_LACKS_CLOCK_MONOTONIC)
#    define ACE_HAS_CLOCK_GETTIME_MONOTONIC
#  endif
#endif

#if defined (ACE_HAS_CONDATTR_SETCLOCK) && defined (ACE_HAS_CLOCK_GETTIME_MONOTONIC)
#  if !defined (ACE_HAS_POSIX_MONOTONIC_CONDITIONS)
#    define ACE_HAS_POSIX_MONOTONIC_CONDITIONS
#  endif
#  if !defined (ACE_HAS_MONOTONIC_CONDITIONS)
#    define ACE_HAS_MONOTONIC_CONDITIONS
#  endif
#endif

#endif /* ACE_CONFIG_POSIX_H */