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