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