feature_tests.c 688 B

1234567891011121314151617181920212223242526272829303132333435
  1. const char features[] = {"\n"
  2. "C_FEATURE:"
  3. #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304
  4. "1"
  5. #else
  6. "0"
  7. #endif
  8. "c_function_prototypes\n"
  9. "C_FEATURE:"
  10. #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  11. "1"
  12. #else
  13. "0"
  14. #endif
  15. "c_restrict\n"
  16. "C_FEATURE:"
  17. #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L
  18. "1"
  19. #else
  20. "0"
  21. #endif
  22. "c_static_assert\n"
  23. "C_FEATURE:"
  24. #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  25. "1"
  26. #else
  27. "0"
  28. #endif
  29. "c_variadic_macros\n"
  30. };
  31. int main(int argc, char** argv) { (void)argv; return features[argc]; }