Rich Felker | c1a9658 | 2012-09-07 23:13:55 -0400 | [diff] [blame] | 1 | #ifndef _FEATURES_H |
| 2 | #define _FEATURES_H |
| 3 | |
Rich Felker | f929493 | 2014-09-10 12:40:38 -0400 | [diff] [blame] | 4 | #if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE) |
Rich Felker | b3175f5 | 2012-12-03 17:02:56 -0500 | [diff] [blame] | 5 | #define _GNU_SOURCE 1 |
| 6 | #endif |
| 7 | |
Rich Felker | 5edbc6f | 2014-09-10 12:47:55 -0400 | [diff] [blame] | 8 | #if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE) |
| 9 | #define _BSD_SOURCE 1 |
| 10 | #endif |
| 11 | |
Rich Felker | c1a9658 | 2012-09-07 23:13:55 -0400 | [diff] [blame] | 12 | #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ |
| 13 | && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ |
| 14 | && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) |
| 15 | #define _BSD_SOURCE 1 |
| 16 | #define _XOPEN_SOURCE 700 |
| 17 | #endif |
| 18 | |
| 19 | #if __STDC_VERSION__ >= 199901L |
| 20 | #define __restrict restrict |
| 21 | #elif !defined(__GNUC__) |
| 22 | #define __restrict |
| 23 | #endif |
| 24 | |
| 25 | #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) |
| 26 | #define __inline inline |
| 27 | #endif |
| 28 | |
| 29 | #if __STDC_VERSION__ >= 201112L |
| 30 | #elif defined(__GNUC__) |
| 31 | #define _Noreturn __attribute__((__noreturn__)) |
| 32 | #else |
| 33 | #define _Noreturn |
| 34 | #endif |
| 35 | |
| 36 | #endif |