features.h 658 B

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