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