1 /*
2  *  Written by Joel Sherrill <joel@OARcorp.com>.
3  *
4  *  COPYRIGHT (c) 1989-2014.
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 #include <picolibc.h>
29 
30 /* Macro to test version of GCC.  Returns 0 for non-GCC or too old GCC. */
31 #ifndef __GNUC_PREREQ
32 # if defined __GNUC__ && defined __GNUC_MINOR__
33 #  define __GNUC_PREREQ(maj, min) \
34 	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
35 # else
36 #  define __GNUC_PREREQ(maj, min) 0
37 # endif
38 #endif /* __GNUC_PREREQ */
39 /* Version with trailing underscores for BSD compatibility. */
40 #define	__GNUC_PREREQ__(ma, mi)	__GNUC_PREREQ(ma, mi)
41 
42 /*
43  * Feature test macros control which symbols are exposed by the system
44  * headers.  Any of these must be defined before including any headers.
45  *
46  * __STRICT_ANSI__ (defined by gcc -ansi, -std=c90, -std=c99, or -std=c11)
47  *	ISO C
48  *
49  * _POSIX_SOURCE (deprecated by _POSIX_C_SOURCE=1)
50  * _POSIX_C_SOURCE >= 1
51  * 	POSIX.1-1990
52  *
53  * _POSIX_C_SOURCE >= 2
54  * 	POSIX.2-1992
55  *
56  * _POSIX_C_SOURCE >= 199309L
57  * 	POSIX.1b-1993 Real-time extensions
58  *
59  * _POSIX_C_SOURCE >= 199506L
60  * 	POSIX.1c-1995 Threads extensions
61  *
62  * _POSIX_C_SOURCE >= 200112L
63  * 	POSIX.1-2001 and C99
64  *
65  * _POSIX_C_SOURCE >= 200809L
66  * 	POSIX.1-2008
67  *
68  * _XOPEN_SOURCE
69  *	POSIX.1-1990 and XPG4
70  *
71  * _XOPEN_SOURCE_EXTENDED
72  *	SUSv1 (POSIX.2-1992 plus XPG4v2)
73  *
74  * _XOPEN_SOURCE >= 500
75  *	SUSv2 (POSIX.1c-1995 plus XSI)
76  *
77  * _XOPEN_SOURCE >= 600
78  *	SUSv3 (POSIX.1-2001 plus XSI) and C99
79  *
80  * _XOPEN_SOURCE >= 700
81  *	SUSv4 (POSIX.1-2008 plus XSI)
82  *
83  * _ISOC99_SOURCE or gcc -std=c99 or g++
84  * 	ISO C99
85  *
86  * _ISOC11_SOURCE or gcc -std=c11 or g++ -std=c++11
87  * 	ISO C11
88  *
89  * _ISOC2x_SOURCE or gcc -std=c2x or g++ -std=c++20
90  * 	ISO C11
91  *
92  * _ATFILE_SOURCE (implied by _POSIX_C_SOURCE >= 200809L)
93  *	"at" functions
94  *
95  * _LARGEFILE_SOURCE (deprecated by _XOPEN_SOURCE >= 500)
96  *	fseeko, ftello
97  *
98  * _GNU_SOURCE
99  * 	All of the above plus GNU extensions
100  *
101  * _BSD_SOURCE (deprecated by _DEFAULT_SOURCE)
102  * _SVID_SOURCE (deprecated by _DEFAULT_SOURCE)
103  * _DEFAULT_SOURCE (or none of the above)
104  * 	POSIX-1.2008 with BSD and SVr4 extensions
105  *
106  * _FORTIFY_SOURCE = 1 or 2
107  * 	Object Size Checking function wrappers
108  *
109  * _ZEPHYR_SOURCE
110  *      Zephyr. ISO C + a small selection of other APIs.
111  */
112 
113 #ifdef _GNU_SOURCE
114 #undef _ATFILE_SOURCE
115 #define	_ATFILE_SOURCE		1
116 #undef	_DEFAULT_SOURCE
117 #define	_DEFAULT_SOURCE		1
118 #undef _ISOC99_SOURCE
119 #define	_ISOC99_SOURCE		1
120 #undef _ISOC11_SOURCE
121 #define	_ISOC11_SOURCE		1
122 #undef _ISOC2X_SOURCE
123 #define	_ISOC2X_SOURCE		1
124 #undef _POSIX_SOURCE
125 #define	_POSIX_SOURCE		1
126 #undef _POSIX_C_SOURCE
127 #define	_POSIX_C_SOURCE		200809L
128 #undef _XOPEN_SOURCE
129 #define	_XOPEN_SOURCE		700
130 #undef _XOPEN_SOURCE_EXTENDED
131 #define	_XOPEN_SOURCE_EXTENDED	1
132 #endif /* _GNU_SOURCE */
133 
134 /* When building for Zephyr, set _ZEPHYR_SOURCE unless some other API
135  * indicator is set by the application. Don't check __STRICT_ANSI__ as that
136  * is set by the compiler for -std=cxx, or _POSIX_C_SOURCE as Zephyr defines
137  * that for picolibc currently.
138  */
139 
140 #if defined(__ZEPHYR__) && !defined(_ZEPHYR_SOURCE) &&                  \
141     !defined(_GNU_SOURCE)&&                                             \
142     !defined(_BSD_SOURCE) &&                                            \
143     !defined(_SVID_SOURCE) &&                                           \
144     !defined(_DEFAULT_SOURCE)
145 #define _ZEPHYR_SOURCE      1
146 #endif
147 
148 #if defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \
149    (!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE) && \
150    !defined(_ISOC99_SOURCE) && !defined(_POSIX_SOURCE) && \
151    !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE) && \
152    !defined(_ZEPHYR_SOURCE))
153 #undef _DEFAULT_SOURCE
154 #define	_DEFAULT_SOURCE		1
155 #endif
156 
157 #if defined(_DEFAULT_SOURCE)
158 #undef _POSIX_SOURCE
159 #define	_POSIX_SOURCE		1
160 #undef _POSIX_C_SOURCE
161 #define	_POSIX_C_SOURCE		200809L
162 #endif
163 
164 #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \
165   ((!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE)) || \
166    (_XOPEN_SOURCE - 0) >= 500)
167 #define	_POSIX_SOURCE		1
168 #if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 700
169 #define	_POSIX_C_SOURCE		200809L
170 #elif (_XOPEN_SOURCE - 0) >= 600
171 #define	_POSIX_C_SOURCE		200112L
172 #elif (_XOPEN_SOURCE - 0) >= 500
173 #define	_POSIX_C_SOURCE		199506L
174 #elif (_XOPEN_SOURCE - 0) < 500
175 #define	_POSIX_C_SOURCE		2
176 #endif
177 #endif
178 
179 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809
180 #undef _ATFILE_SOURCE
181 #define	_ATFILE_SOURCE		1
182 #endif
183 
184 #ifdef _ZEPHYR_SOURCE
185 #undef _ISOC99_SOURCE
186 #define	_ISOC99_SOURCE		1
187 #undef _ISOC11_SOURCE
188 #define	_ISOC11_SOURCE		1
189 #undef _ANSI_SOURCE
190 #define _ANSI_SOURCE            1
191 #endif
192 
193 /*
194  * The following private macros are used throughout the headers to control
195  * which symbols should be exposed.  They are for internal use only, as
196  * indicated by the leading double underscore, and must never be used outside
197  * of these headers.
198  *
199  * __POSIX_VISIBLE
200  * 	any version of POSIX.1; enabled by default, or with _POSIX_SOURCE,
201  * 	any value of _POSIX_C_SOURCE, or _XOPEN_SOURCE >= 500.
202  *
203  * __POSIX_VISIBLE >= 2
204  * 	POSIX.2-1992; enabled by default, with _POSIX_C_SOURCE >= 2,
205  * 	or _XOPEN_SOURCE >= 500.
206  *
207  * __POSIX_VISIBLE >= 199309
208  * 	POSIX.1b-1993; enabled by default, with _POSIX_C_SOURCE >= 199309L,
209  * 	or _XOPEN_SOURCE >= 500.
210  *
211  * __POSIX_VISIBLE >= 199506
212  * 	POSIX.1c-1995; enabled by default, with _POSIX_C_SOURCE >= 199506L,
213  * 	or _XOPEN_SOURCE >= 500.
214  *
215  * __POSIX_VISIBLE >= 200112
216  * 	POSIX.1-2001; enabled by default, with _POSIX_C_SOURCE >= 200112L,
217  * 	or _XOPEN_SOURCE >= 600.
218  *
219  * __POSIX_VISIBLE >= 200809
220  * 	POSIX.1-2008; enabled by default, with _POSIX_C_SOURCE >= 200809L,
221  * 	or _XOPEN_SOURCE >= 700.
222  *
223  * __XSI_VISIBLE
224  *	XPG4 XSI extensions; enabled with any version of _XOPEN_SOURCE.
225  *
226  * __XSI_VISIBLE >= 4
227  *	SUSv1 XSI extensions; enabled with both _XOPEN_SOURCE and
228  * 	_XOPEN_SOURCE_EXTENDED together.
229  *
230  * __XSI_VISIBLE >= 500
231  *	SUSv2 XSI extensions; enabled with _XOPEN_SOURCE >= 500.
232  *
233  * __XSI_VISIBLE >= 600
234  *	SUSv3 XSI extensions; enabled with _XOPEN_SOURCE >= 600.
235  *
236  * __XSI_VISIBLE >= 700
237  *	SUSv4 XSI extensions; enabled with _XOPEN_SOURCE >= 700.
238  *
239  * __ISO_C_VISIBLE >= 1999
240  * 	ISO C99; enabled with gcc -std=c99 or newer (on by default since GCC 5),
241  * 	any version of C++, or with _ISOC99_SOURCE, _POSIX_C_SOURCE >= 200112L,
242  * 	or _XOPEN_SOURCE >= 600.
243  *
244  * __ISO_C_VISIBLE >= 2011
245  * 	ISO C11; enabled with gcc -std=c11 or newer (on by default since GCC 5),
246  * 	g++ -std=c++11 or newer (on by default since GCC 6), or with
247  * 	_ISOC11_SOURCE.
248  *
249  * __ISO_C_VISIBLE >= 2020
250  * 	ISO C2x; enabled with gcc -std=c2x or newer,
251  * 	g++ -std=c++20 or newer, or with
252  * 	_ISOC2X_SOURCE.
253  *
254  * __ATFILE_VISIBLE
255  *	"at" functions; enabled by default, with _ATFILE_SOURCE,
256  * 	_POSIX_C_SOURCE >= 200809L, or _XOPEN_SOURCE >= 700.
257  *
258  * __LARGEFILE_VISIBLE
259  *	fseeko, ftello; enabled with _LARGEFILE_SOURCE or _XOPEN_SOURCE >= 500.
260  *
261  * __BSD_VISIBLE
262  * 	BSD extensions; enabled by default, or with _BSD_SOURCE.
263  *
264  * __SVID_VISIBLE
265  * 	SVr4 extensions; enabled by default, or with _SVID_SOURCE.
266  *
267  * __MISC_VISIBLE
268  * 	Extensions found in both BSD and SVr4 (shorthand for
269  * 	(__BSD_VISIBLE || __SVID_VISIBLE)), or newlib-specific
270  * 	extensions; enabled by default.
271  *
272  * __GNU_VISIBLE
273  * 	GNU extensions; enabled with _GNU_SOURCE.
274  *
275  * __SSP_FORTIFY_LEVEL
276  * 	Object Size Checking; defined to 0 (off), 1, or 2.
277  *
278  * __ZEPHYR_VISIBLE
279  *      Zephyr extensions; enabled with _ZEPHYR_SOURCE.
280  *
281  * In all cases above, "enabled by default" means either by defining
282  * _DEFAULT_SOURCE, or by not defining any of the public feature test macros.
283  */
284 
285 #ifdef _ATFILE_SOURCE
286 #define	__ATFILE_VISIBLE	1
287 #else
288 #define	__ATFILE_VISIBLE	0
289 #endif
290 
291 #ifdef _DEFAULT_SOURCE
292 #define	__BSD_VISIBLE		1
293 #else
294 #define	__BSD_VISIBLE		0
295 #endif
296 
297 #ifdef _GNU_SOURCE
298 #define	__GNU_VISIBLE		1
299 #else
300 #define	__GNU_VISIBLE		0
301 #endif
302 
303 #ifdef _ZEPHYR_SOURCE
304 #define __ZEPHYR_VISIBLE        1
305 #else
306 #define __ZEPHYR_VISIBLE        0
307 #endif
308 
309 #if defined(_ISOC2X_SOURCE) || \
310   (__STDC_VERSION__ - 0) > 201710L || (__cplusplus - 0) >= 202002L
311 #define __ISO_C_VISIBLE		2020
312 #elif defined(_ISOC11_SOURCE) || \
313   (__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L
314 #define	__ISO_C_VISIBLE		2011
315 #elif defined(_ISOC99_SOURCE) || (_POSIX_C_SOURCE - 0) >= 200112L || \
316   (__STDC_VERSION__ - 0) >= 199901L || defined(__cplusplus)
317 #define	__ISO_C_VISIBLE		1999
318 #else
319 #define	__ISO_C_VISIBLE		1990
320 #endif
321 
322 #if defined(_LARGEFILE_SOURCE) || (_XOPEN_SOURCE - 0) >= 500
323 #define	__LARGEFILE_VISIBLE	1
324 #else
325 #define	__LARGEFILE_VISIBLE	0
326 #endif
327 
328 #ifdef _DEFAULT_SOURCE
329 #define	__MISC_VISIBLE		1
330 #else
331 #define	__MISC_VISIBLE		0
332 #endif
333 
334 #if (_POSIX_C_SOURCE - 0) >= 200809L
335 #define	__POSIX_VISIBLE		200809
336 #elif (_POSIX_C_SOURCE - 0) >= 200112L
337 #define	__POSIX_VISIBLE		200112
338 #elif (_POSIX_C_SOURCE - 0) >= 199506L
339 #define	__POSIX_VISIBLE		199506
340 #elif (_POSIX_C_SOURCE - 0) >= 199309L
341 #define	__POSIX_VISIBLE		199309
342 #elif (_POSIX_C_SOURCE - 0) >= 2 || defined(_XOPEN_SOURCE)
343 #define	__POSIX_VISIBLE		199209
344 #elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)
345 #define	__POSIX_VISIBLE		199009
346 #else
347 #define	__POSIX_VISIBLE		0
348 #endif
349 
350 #ifdef _DEFAULT_SOURCE
351 #define	__SVID_VISIBLE		1
352 #else
353 #define	__SVID_VISIBLE		0
354 #endif
355 
356 #if (_XOPEN_SOURCE - 0) >= 700
357 #define	__XSI_VISIBLE		700
358 #elif (_XOPEN_SOURCE - 0) >= 600
359 #define	__XSI_VISIBLE		600
360 #elif (_XOPEN_SOURCE - 0) >= 500
361 #define	__XSI_VISIBLE		500
362 #elif defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)
363 #define	__XSI_VISIBLE		4
364 #elif defined(_XOPEN_SOURCE)
365 #define	__XSI_VISIBLE		1
366 #else
367 #define	__XSI_VISIBLE		0
368 #endif
369 
370 #if _FORTIFY_SOURCE > 0 && !defined(__cplusplus) && !defined(__lint__) && \
371    (__OPTIMIZE__ > 0 || defined(__clang__)) && __GNUC_PREREQ__(4, 1) && \
372    !defined(_LIBC)
373 #  if _FORTIFY_SOURCE > 1
374 #    define __SSP_FORTIFY_LEVEL 2
375 #  else
376 #    define __SSP_FORTIFY_LEVEL 1
377 #  endif
378 #else
379 #  define __SSP_FORTIFY_LEVEL 0
380 #endif
381 
382 /* RTEMS adheres to POSIX -- 1003.1b with some features from annexes.  */
383 
384 #ifdef __rtems__
385 #define _POSIX_JOB_CONTROL     		1
386 #define _POSIX_SAVED_IDS       		1
387 #define _POSIX_VERSION			199309L
388 #define _POSIX_ASYNCHRONOUS_IO		1
389 #define _POSIX_FSYNC			1
390 #define _POSIX_MAPPED_FILES		1
391 #define _POSIX_MEMLOCK			1
392 #define _POSIX_MEMLOCK_RANGE		1
393 #define _POSIX_MEMORY_PROTECTION	1
394 #define _POSIX_MESSAGE_PASSING		1
395 #define _POSIX_MONOTONIC_CLOCK		200112L
396 #define _POSIX_CLOCK_SELECTION		200112L
397 #define _POSIX_PRIORITIZED_IO		1
398 #define _POSIX_PRIORITY_SCHEDULING	1
399 #define _POSIX_REALTIME_SIGNALS		1
400 #define _POSIX_SEMAPHORES		1
401 #define _POSIX_SHARED_MEMORY_OBJECTS	1
402 #define _POSIX_SYNCHRONIZED_IO		1
403 #define _POSIX_TIMERS			1
404 #define _POSIX_BARRIERS                 200112L
405 #define _POSIX_READER_WRITER_LOCKS      200112L
406 #define _POSIX_SPIN_LOCKS               200112L
407 
408 
409 /* In P1003.1b but defined by drafts at least as early as P1003.1c/D10  */
410 #define _POSIX_THREADS				1
411 #define _POSIX_THREAD_ATTR_STACKADDR		1
412 #define _POSIX_THREAD_ATTR_STACKSIZE		1
413 #define _POSIX_THREAD_PRIORITY_SCHEDULING	1
414 #define _POSIX_THREAD_PRIO_INHERIT		1
415 #define _POSIX_THREAD_PRIO_PROTECT		1
416 #define _POSIX_THREAD_PROCESS_SHARED		1
417 #define _POSIX_THREAD_SAFE_FUNCTIONS		1
418 
419 /* P1003.4b/D8 defines the constants below this comment. */
420 #define _POSIX_SPAWN				1
421 #define _POSIX_TIMEOUTS				1
422 #define _POSIX_CPUTIME				1
423 #define _POSIX_THREAD_CPUTIME			1
424 #define _POSIX_SPORADIC_SERVER			1
425 #define _POSIX_THREAD_SPORADIC_SERVER		1
426 #define _POSIX_DEVICE_CONTROL			1
427 #define _POSIX_DEVCTL_DIRECTION			1
428 #define _POSIX_INTERRUPT_CONTROL		1
429 #define _POSIX_ADVISORY_INFO			1
430 
431 /* UNIX98 added some new pthread mutex attributes */
432 #define _UNIX98_THREAD_MUTEX_ATTRIBUTES         1
433 
434 /* POSIX 1003.26-2003 defined device control method */
435 #define _POSIX_26_VERSION			200312L
436 
437 #endif
438 
439 /* XMK loosely adheres to POSIX -- 1003.1 */
440 #ifdef __XMK__
441 #define _POSIX_THREADS				1
442 #define _POSIX_THREAD_PRIORITY_SCHEDULING	1
443 #endif
444 
445 
446 #ifdef __svr4__
447 # define _POSIX_JOB_CONTROL     1
448 # define _POSIX_SAVED_IDS       1
449 # define _POSIX_VERSION 199009L
450 #endif
451 
452 #ifdef __CYGWIN__
453 
454 #if __POSIX_VISIBLE >= 200809
455 #define _POSIX_VERSION				200809L
456 #define _POSIX2_VERSION				200809L
457 #elif __POSIX_VISIBLE >= 200112
458 #define _POSIX_VERSION				200112L
459 #define _POSIX2_VERSION				200112L
460 #elif __POSIX_VISIBLE >= 199506
461 #define _POSIX_VERSION				199506L
462 #define _POSIX2_VERSION				199506L
463 #elif __POSIX_VISIBLE >= 199309
464 #define _POSIX_VERSION				199309L
465 #define _POSIX2_VERSION				199209L
466 #elif __POSIX_VISIBLE >= 199209
467 #define _POSIX_VERSION				199009L
468 #define _POSIX2_VERSION				199209L
469 #elif __POSIX_VISIBLE
470 #define _POSIX_VERSION				199009L
471 #endif
472 #if __XSI_VISIBLE >= 4
473 #define _XOPEN_VERSION				__XSI_VISIBLE
474 #endif
475 
476 #define _POSIX_ADVISORY_INFO			200809L
477 #define _POSIX_ASYNCHRONOUS_IO			200809L
478 #define _POSIX_BARRIERS				200809L
479 #define _POSIX_CHOWN_RESTRICTED			     1
480 #define _POSIX_CLOCK_SELECTION			200809L
481 #define _POSIX_CPUTIME				200809L
482 #define _POSIX_FSYNC				200809L
483 #define _POSIX_IPV6				200809L
484 #define _POSIX_JOB_CONTROL			     1
485 #define _POSIX_MAPPED_FILES			200809L
486 /* #define _POSIX_MEMLOCK			    -1 */
487 #define _POSIX_MEMLOCK_RANGE			200809L
488 #define _POSIX_MEMORY_PROTECTION		200809L
489 #define _POSIX_MESSAGE_PASSING			200809L
490 #define _POSIX_MONOTONIC_CLOCK			200809L
491 #define _POSIX_NO_TRUNC				     1
492 /* #define _POSIX_PRIORITIZED_IO		    -1 */
493 #define _POSIX_PRIORITY_SCHEDULING		200809L
494 #define _POSIX_RAW_SOCKETS			200809L
495 #define _POSIX_READER_WRITER_LOCKS		200809L
496 #define _POSIX_REALTIME_SIGNALS			200809L
497 #define _POSIX_REGEXP				     1
498 #define _POSIX_SAVED_IDS			     1
499 #define _POSIX_SEMAPHORES			200809L
500 #define _POSIX_SHARED_MEMORY_OBJECTS		200809L
501 #define _POSIX_SHELL				     1
502 #define _POSIX_SPAWN				200809L
503 #define _POSIX_SPIN_LOCKS			200809L
504 /* #define _POSIX_SPORADIC_SERVER		    -1 */
505 #define _POSIX_SYNCHRONIZED_IO			200809L
506 #define _POSIX_THREAD_ATTR_STACKADDR		200809L
507 #define _POSIX_THREAD_ATTR_STACKSIZE		200809L
508 #define _POSIX_THREAD_CPUTIME			200809L
509 /* #define _POSIX_THREAD_PRIO_INHERIT		    -1 */
510 /* #define _POSIX_THREAD_PRIO_PROTECT		    -1 */
511 #define _POSIX_THREAD_PRIORITY_SCHEDULING	200809L
512 #define _POSIX_THREAD_PROCESS_SHARED		200809L
513 #define _POSIX_THREAD_SAFE_FUNCTIONS		200809L
514 /* #define _POSIX_THREAD_SPORADIC_SERVER	    -1 */
515 #define _POSIX_THREADS				200809L
516 #define _POSIX_TIMEOUTS				200809L
517 #define _POSIX_TIMERS				200809L
518 /* #define _POSIX_TRACE				    -1 */
519 /* #define _POSIX_TRACE_EVENT_FILTER		    -1 */
520 /* #define _POSIX_TRACE_INHERIT			    -1 */
521 /* #define _POSIX_TRACE_LOG			    -1 */
522 /* #define _POSIX_TYPED_MEMORY_OBJECTS		    -1 */
523 #define _POSIX_VDISABLE				   '\0'
524 
525 #if __POSIX_VISIBLE >= 2
526 #define _POSIX2_C_VERSION			_POSIX2_VERSION
527 #define _POSIX2_C_BIND				_POSIX2_VERSION
528 #define _POSIX2_C_DEV				_POSIX2_VERSION
529 #define _POSIX2_CHAR_TERM			_POSIX2_VERSION
530 /* #define _POSIX2_FORT_DEV			    -1 */
531 /* #define _POSIX2_FORT_RUN			    -1 */
532 /* #define _POSIX2_LOCALEDEF			    -1 */
533 /* #define _POSIX2_PBS				    -1 */
534 /* #define _POSIX2_PBS_ACCOUNTING		    -1 */
535 /* #define _POSIX2_PBS_CHECKPOINT		    -1 */
536 /* #define _POSIX2_PBS_LOCATE			    -1 */
537 /* #define _POSIX2_PBS_MESSAGE			    -1 */
538 /* #define _POSIX2_PBS_TRACK			    -1 */
539 #define _POSIX2_SW_DEV				_POSIX2_VERSION
540 #define _POSIX2_UPE				_POSIX2_VERSION
541 #endif /* __POSIX_VISIBLE >= 2 */
542 
543 #define _POSIX_V6_ILP32_OFF32			    -1
544 #ifdef __LP64__
545 #define _POSIX_V6_ILP32_OFFBIG			    -1
546 #define _POSIX_V6_LP64_OFF64			     1
547 #define _POSIX_V6_LPBIG_OFFBIG			     1
548 #else
549 #define _POSIX_V6_ILP32_OFFBIG			     1
550 #define _POSIX_V6_LP64_OFF64			    -1
551 #define _POSIX_V6_LPBIG_OFFBIG			    -1
552 #endif
553 #define _POSIX_V7_ILP32_OFF32			_POSIX_V6_ILP32_OFF32
554 #define _POSIX_V7_ILP32_OFFBIG			_POSIX_V6_ILP32_OFFBIG
555 #define _POSIX_V7_LP64_OFF64			_POSIX_V6_LP64_OFF64
556 #define _POSIX_V7_LPBIG_OFFBIG			_POSIX_V6_LPBIG_OFFBIG
557 #define _XBS5_ILP32_OFF32			_POSIX_V6_ILP32_OFF32
558 #define _XBS5_ILP32_OFFBIG			_POSIX_V6_ILP32_OFFBIG
559 #define _XBS5_LP64_OFF64			_POSIX_V6_LP64_OFF64
560 #define _XBS5_LPBIG_OFFBIG			_POSIX_V6_LPBIG_OFFBIG
561 
562 #if __XSI_VISIBLE
563 #define _XOPEN_CRYPT				     1
564 #define _XOPEN_ENH_I18N				     1
565 /* #define _XOPEN_LEGACY			    -1 */
566 /* #define _XOPEN_REALTIME			    -1 */
567 /* #define _XOPEN_REALTIME_THREADS		    -1 */
568 #define _XOPEN_SHM				     1
569 /* #define _XOPEN_STREAMS			    -1 */
570 /* #define _XOPEN_UNIX				    -1 */
571 #endif /* __XSI_VISIBLE */
572 
573 /*
574  * newlib's wide char conversion functions were updated on
575  *	2019-01-12
576  * to UNICODE version:
577  *	11.0.0 released 2018-06-05
578  */
579 #define __STDC_ISO_10646__ 201806L
580 
581 #endif /* __CYGWIN__ */
582 
583 #ifdef __cplusplus
584 }
585 #endif
586 #endif /* _SYS_FEATURES_H */
587