Merge pull request #75 from hnyman/fix-ncurses
[openwrt-github/.git] / toolchain / musl / include / features.h
1 #ifndef _FEATURES_H
2 #define _FEATURES_H
3
4 #ifdef _ALL_SOURCE
5 #define _GNU_SOURCE 1
6 #endif
7
8 #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \
9  && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \
10  && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__)
11 #define _BSD_SOURCE 1
12 #define _XOPEN_SOURCE 700
13 #endif
14
15 #if __STDC_VERSION__ >= 199901L
16 #define __restrict restrict
17 #elif !defined(__GNUC__)
18 #define __restrict
19 #endif
20
21 #if __STDC_VERSION__ >= 199901L || defined(__cplusplus)
22 #define __inline inline
23 #endif
24
25 #if __STDC_VERSION__ >= 201112L
26 #elif defined(__GNUC__)
27 #define _Noreturn __attribute__((__noreturn__))
28 #else
29 #define _Noreturn
30 #endif
31
32 /* Convenience macros to test the versions of glibc and gcc.
33    Use them like this:
34    #if __GNUC_PREREQ (2,8)
35    ... code requiring gcc 2.8 or later ...
36    #endif
37    Note - they won't work for gcc1 or glibc1, since the _MINOR macros
38    were not defined then.  */
39 #if defined __GNUC__ && defined __GNUC_MINOR__
40 # define __GNUC_PREREQ(maj, min) \
41         ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
42 #else
43 # define __GNUC_PREREQ(maj, min) 0
44 #endif
45
46 #include <sys/glibc-types.h>
47
48 #endif