CheckFunctionExists.c 433 B

12345678910111213141516171819202122232425262728
  1. #ifdef CHECK_FUNCTION_EXISTS
  2. # ifdef __cplusplus
  3. extern "C"
  4. # endif
  5. char
  6. CHECK_FUNCTION_EXISTS(void);
  7. # ifdef __CLASSIC_C__
  8. int main()
  9. {
  10. int ac;
  11. char* av[];
  12. # else
  13. int main(int ac, char* av[])
  14. {
  15. # endif
  16. CHECK_FUNCTION_EXISTS();
  17. if (ac > 1000) {
  18. return *av[0];
  19. }
  20. return 0;
  21. }
  22. #else /* CHECK_FUNCTION_EXISTS */
  23. # error "CHECK_FUNCTION_EXISTS has to specify the function"
  24. #endif /* CHECK_FUNCTION_EXISTS */