Rev 4874 | Rev 6099 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | /* |
2 | * Written by Joel Sherrill |
||
3 | * |
||
4 | * COPYRIGHT (c) 1989-2000. |
||
5 | * |
||
6 | * On-Line Applications Research Corporation (OAR). |
||
7 | * |
||
8 | * Permission to use, copy, modify, and distribute this software for any |
||
9 | * purpose without fee is hereby granted, provided that this entire notice |
||
10 | * is included in all copies of any software which is or includes a copy |
||
11 | * or modification of this software. |
||
12 | * |
||
13 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED |
||
14 | * WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION |
||
15 | * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS |
||
16 | * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. |
||
17 | * |
||
4921 | Serge | 18 | * $Id: features.h,v 1.30 2013/04/23 09:42:25 corinna Exp $ |
4349 | Serge | 19 | */ |
20 | |||
21 | #ifndef _SYS_FEATURES_H |
||
22 | #define _SYS_FEATURES_H |
||
23 | |||
24 | #ifdef __cplusplus |
||
25 | extern "C" { |
||
26 | #endif |
||
27 | |||
4921 | Serge | 28 | /* Macro to test version of GCC. Returns 0 for non-GCC or too old GCC. */ |
29 | #ifndef __GNUC_PREREQ |
||
30 | # if defined __GNUC__ && defined __GNUC_MINOR__ |
||
31 | # define __GNUC_PREREQ(maj, min) \ |
||
32 | ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) |
||
33 | # else |
||
34 | # define __GNUC_PREREQ(maj, min) 0 |
||
35 | # endif |
||
36 | #endif /* __GNUC_PREREQ */ |
||
37 | /* Version with trailing underscores for BSD compatibility. */ |
||
38 | #define __GNUC_PREREQ__(ma, mi) __GNUC_PREREQ(ma, mi) |
||
39 | |||
4349 | Serge | 40 | /* RTEMS adheres to POSIX -- 1003.1b with some features from annexes. */ |
41 | |||
42 | #ifdef __rtems__ |
||
43 | #define _POSIX_JOB_CONTROL 1 |
||
44 | #define _POSIX_SAVED_IDS 1 |
||
45 | #define _POSIX_VERSION 199309L |
||
46 | #define _POSIX_ASYNCHRONOUS_IO 1 |
||
47 | #define _POSIX_FSYNC 1 |
||
48 | #define _POSIX_MAPPED_FILES 1 |
||
49 | #define _POSIX_MEMLOCK 1 |
||
50 | #define _POSIX_MEMLOCK_RANGE 1 |
||
51 | #define _POSIX_MEMORY_PROTECTION 1 |
||
52 | #define _POSIX_MESSAGE_PASSING 1 |
||
53 | #define _POSIX_MONOTONIC_CLOCK 200112L |
||
54 | #define _POSIX_PRIORITIZED_IO 1 |
||
55 | #define _POSIX_PRIORITY_SCHEDULING 1 |
||
56 | #define _POSIX_REALTIME_SIGNALS 1 |
||
57 | #define _POSIX_SEMAPHORES 1 |
||
58 | /* #define _POSIX_SHARED_MEMORY_OBJECTS 1 */ |
||
59 | #define _POSIX_SYNCHRONIZED_IO 1 |
||
60 | #define _POSIX_TIMERS 1 |
||
61 | #define _POSIX_BARRIERS 200112L |
||
62 | #define _POSIX_READER_WRITER_LOCKS 200112L |
||
63 | #define _POSIX_SPIN_LOCKS 200112L |
||
64 | |||
65 | |||
66 | /* In P1003.1b but defined by drafts at least as early as P1003.1c/D10 */ |
||
67 | #define _POSIX_THREADS 1 |
||
68 | #define _POSIX_THREAD_ATTR_STACKADDR 1 |
||
69 | #define _POSIX_THREAD_ATTR_STACKSIZE 1 |
||
70 | #define _POSIX_THREAD_PRIORITY_SCHEDULING 1 |
||
71 | #define _POSIX_THREAD_PRIO_INHERIT 1 |
||
72 | #define _POSIX_THREAD_PRIO_PROTECT 1 |
||
73 | #define _POSIX_THREAD_PROCESS_SHARED 1 |
||
74 | #define _POSIX_THREAD_SAFE_FUNCTIONS 1 |
||
75 | |||
76 | /* P1003.4b/D8 defines the constants below this comment. */ |
||
77 | #define _POSIX_SPAWN 1 |
||
78 | #define _POSIX_TIMEOUTS 1 |
||
79 | #define _POSIX_CPUTIME 1 |
||
80 | #define _POSIX_THREAD_CPUTIME 1 |
||
81 | #define _POSIX_SPORADIC_SERVER 1 |
||
82 | #define _POSIX_THREAD_SPORADIC_SERVER 1 |
||
83 | #define _POSIX_DEVICE_CONTROL 1 |
||
84 | #define _POSIX_DEVCTL_DIRECTION 1 |
||
85 | #define _POSIX_INTERRUPT_CONTROL 1 |
||
86 | #define _POSIX_ADVISORY_INFO 1 |
||
87 | |||
88 | /* UNIX98 added some new pthread mutex attributes */ |
||
89 | #define _UNIX98_THREAD_MUTEX_ATTRIBUTES 1 |
||
90 | |||
91 | #endif |
||
92 | |||
93 | /* XMK loosely adheres to POSIX -- 1003.1 */ |
||
94 | #ifdef __XMK__ |
||
95 | #define _POSIX_THREADS 1 |
||
96 | #define _POSIX_THREAD_PRIORITY_SCHEDULING 1 |
||
97 | #endif |
||
98 | |||
99 | |||
100 | #ifdef __svr4__ |
||
101 | # define _POSIX_JOB_CONTROL 1 |
||
102 | # define _POSIX_SAVED_IDS 1 |
||
103 | # define _POSIX_VERSION 199009L |
||
104 | #endif |
||
105 | |||
106 | #ifdef __CYGWIN__ |
||
107 | |||
108 | #if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L |
||
109 | #define _POSIX_VERSION 200112L |
||
110 | #define _POSIX2_VERSION 200112L |
||
111 | #define _XOPEN_VERSION 600 |
||
112 | |||
113 | #define _POSIX_ADVISORY_INFO 200112L |
||
114 | /* #define _POSIX_ASYNCHRONOUS_IO -1 */ |
||
115 | /* #define _POSIX_BARRIERS -1 */ |
||
116 | #define _POSIX_CHOWN_RESTRICTED 1 |
||
117 | #define _POSIX_CLOCK_SELECTION 200112L |
||
118 | #define _POSIX_CPUTIME 200112L |
||
119 | #define _POSIX_FSYNC 200112L |
||
120 | #define _POSIX_IPV6 200112L |
||
121 | #define _POSIX_JOB_CONTROL 1 |
||
122 | #define _POSIX_MAPPED_FILES 200112L |
||
123 | /* #define _POSIX_MEMLOCK -1 */ |
||
124 | #define _POSIX_MEMLOCK_RANGE 200112L |
||
125 | #define _POSIX_MEMORY_PROTECTION 200112L |
||
126 | #define _POSIX_MESSAGE_PASSING 200112L |
||
127 | #define _POSIX_MONOTONIC_CLOCK 200112L |
||
128 | #define _POSIX_NO_TRUNC 1 |
||
129 | /* #define _POSIX_PRIORITIZED_IO -1 */ |
||
130 | #define _POSIX_PRIORITY_SCHEDULING 200112L |
||
131 | #define _POSIX_RAW_SOCKETS 200112L |
||
132 | #define _POSIX_READER_WRITER_LOCKS 200112L |
||
133 | #define _POSIX_REALTIME_SIGNALS 200112L |
||
134 | #define _POSIX_REGEXP 1 |
||
135 | #define _POSIX_SAVED_IDS 1 |
||
136 | #define _POSIX_SEMAPHORES 200112L |
||
137 | #define _POSIX_SHARED_MEMORY_OBJECTS 200112L |
||
138 | #define _POSIX_SHELL 1 |
||
139 | /* #define _POSIX_SPAWN -1 */ |
||
140 | #define _POSIX_SPIN_LOCKS 200112L |
||
141 | /* #define _POSIX_SPORADIC_SERVER -1 */ |
||
142 | #define _POSIX_SYNCHRONIZED_IO 200112L |
||
143 | #define _POSIX_THREAD_ATTR_STACKADDR 200112L |
||
144 | #define _POSIX_THREAD_ATTR_STACKSIZE 200112L |
||
145 | #define _POSIX_THREAD_CPUTIME 200112L |
||
146 | /* #define _POSIX_THREAD_PRIO_INHERIT -1 */ |
||
147 | /* #define _POSIX_THREAD_PRIO_PROTECT -1 */ |
||
148 | #define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L |
||
149 | #define _POSIX_THREAD_PROCESS_SHARED 200112L |
||
150 | #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L |
||
151 | /* #define _POSIX_THREAD_SPORADIC_SERVER -1 */ |
||
152 | #define _POSIX_THREADS 200112L |
||
153 | /* #define _POSIX_TIMEOUTS -1 */ |
||
154 | #define _POSIX_TIMERS 1 |
||
155 | /* #define _POSIX_TRACE -1 */ |
||
156 | /* #define _POSIX_TRACE_EVENT_FILTER -1 */ |
||
157 | /* #define _POSIX_TRACE_INHERIT -1 */ |
||
158 | /* #define _POSIX_TRACE_LOG -1 */ |
||
159 | /* #define _POSIX_TYPED_MEMORY_OBJECTS -1 */ |
||
160 | #define _POSIX_VDISABLE '\0' |
||
161 | #define _POSIX2_C_BIND 200112L |
||
162 | #define _POSIX2_C_DEV 200112L |
||
163 | #define _POSIX2_CHAR_TERM 200112L |
||
164 | /* #define _POSIX2_FORT_DEV -1 */ |
||
165 | /* #define _POSIX2_FORT_RUN -1 */ |
||
166 | /* #define _POSIX2_LOCALEDEF -1 */ |
||
167 | /* #define _POSIX2_PBS -1 */ |
||
168 | /* #define _POSIX2_PBS_ACCOUNTING -1 */ |
||
169 | /* #define _POSIX2_PBS_CHECKPOINT -1 */ |
||
170 | /* #define _POSIX2_PBS_LOCATE -1 */ |
||
171 | /* #define _POSIX2_PBS_MESSAGE -1 */ |
||
172 | /* #define _POSIX2_PBS_TRACK -1 */ |
||
173 | #define _POSIX2_SW_DEV 200112L |
||
174 | #define _POSIX2_UPE 200112L |
||
175 | #define _POSIX_V6_ILP32_OFF32 -1 |
||
4921 | Serge | 176 | #ifdef __LP64__ |
177 | #define _POSIX_V6_ILP32_OFFBIG -1 |
||
178 | #define _POSIX_V6_LP64_OFF64 1 |
||
179 | #define _POSIX_V6_LPBIG_OFFBIG 1 |
||
180 | #else |
||
181 | #define _POSIX_V6_ILP32_OFFBIG 1 |
||
182 | #define _POSIX_V6_LP64_OFF64 -1 |
||
183 | #define _POSIX_V6_LPBIG_OFFBIG -1 |
||
184 | #endif |
||
4349 | Serge | 185 | #define _XBS5_ILP32_OFF32 _POSIX_V6_ILP32_OFF32 |
186 | #define _XBS5_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG |
||
187 | #define _XBS5_LP64_OFF64 _POSIX_V6_LP64_OFF64 |
||
188 | #define _XBS5_LPBIG_OFFBIG _POSIX_V6_LPBIG_OFFBIG |
||
189 | #define _XOPEN_CRYPT 1 |
||
190 | #define _XOPEN_ENH_I18N 1 |
||
191 | /* #define _XOPEN_LEGACY -1 */ |
||
192 | /* #define _XOPEN_REALTIME -1 */ |
||
193 | /* #define _XOPEN_REALTIME_THREADS -1 */ |
||
194 | #define _XOPEN_SHM 1 |
||
195 | /* #define _XOPEN_STREAMS -1 */ |
||
196 | /* #define _XOPEN_UNIX -1 */ |
||
197 | |||
198 | #endif /* !__STRICT_ANSI__ || __cplusplus || __STDC_VERSION__ >= 199901L */ |
||
199 | |||
200 | /* The value corresponds to UNICODE version 4.0, which is the version |
||
201 | supported by XP. Newlib supports 5.2 (2011) but so far Cygwin needs |
||
202 | the MS conversions for double-byte charsets. */ |
||
203 | #define __STDC_ISO_10646__ 200305L |
||
204 | |||
205 | #endif /* __CYGWIN__ */ |
||
206 | |||
207 | /* Per the permission given in POSIX.1-2008 section 2.2.1, define |
||
208 | * _POSIX_C_SOURCE if _XOPEN_SOURCE is defined and _POSIX_C_SOURCE is not. |
||
209 | * (_XOPEN_SOURCE indicates that XSI extensions are desired by an application.) |
||
210 | * This permission is first granted in 2008, but use it for older ones, also. |
||
211 | * Allow for _XOPEN_SOURCE to be empty (from the earliest form of it, before it |
||
212 | * was required to have specific values). |
||
213 | */ |
||
214 | #if !defined(_POSIX_C_SOURCE) && defined(_XOPEN_SOURCE) |
||
215 | #if (_XOPEN_SOURCE - 0) == 700 /* POSIX.1-2008 */ |
||
216 | #define _POSIX_C_SOURCE 200809L |
||
217 | #elif (_XOPEN_SOURCE - 0) == 600 /* POSIX.1-2001 or 2004 */ |
||
218 | #define _POSIX_C_SOURCE 200112L |
||
219 | #elif (_XOPEN_SOURCE - 0) == 500 /* POSIX.1-1995 */ |
||
220 | #define _POSIX_C_SOURCE 199506L |
||
221 | #elif (_XOPEN_SOURCE - 0) < 500 /* really old */ |
||
222 | #define _POSIX_C_SOURCE 2 |
||
223 | #endif |
||
224 | #endif |
||
225 | |||
226 | #ifdef __cplusplus |
||
227 | } |
||
228 | #endif |
||
229 | #endif /* _SYS_FEATURES_H */>><>><> |