features.h 865 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _FEATURES_H
  2. #define _FEATURES_H
  3. #if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE)
  4. #define _GNU_SOURCE 1
  5. #endif
  6. #if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE)
  7. #define _BSD_SOURCE 1
  8. #endif
  9. #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \
  10. && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \
  11. && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__)
  12. #define _BSD_SOURCE 1
  13. #define _XOPEN_SOURCE 700
  14. #endif
  15. #if __STDC_VERSION__ >= 199901L
  16. #define __restrict restrict
  17. #elif !defined(__GNUC__)
  18. #define __restrict
  19. #endif
  20. #if __STDC_VERSION__ >= 199901L || defined(__cplusplus)
  21. #define __inline inline
  22. #elif !defined(__GNUC__)
  23. #define __inline
  24. #endif
  25. #if __STDC_VERSION__ >= 201112L
  26. #elif defined(__GNUC__)
  27. #define _Noreturn __attribute__((__noreturn__))
  28. #else
  29. #define _Noreturn
  30. #endif
  31. #define __REDIR(x,y) __typeof__(x) x __asm__(#y)
  32. #endif