CheckSharedFunctionExists.c 659 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifdef CHECK_SHARED_FUNCTION_EXISTS
  2. #include <stdlib.h>
  3. #ifndef CALLSTACK
  4. #define CALLSTACK
  5. #endif
  6. #ifdef _WIN32
  7. #ifdef ARGSTACK
  8. char __stdcall CHECK_SHARED_FUNCTION_EXISTS(ARGSTACK);
  9. #else
  10. char __stdcall CHECK_SHARED_FUNCTION_EXISTS(void);
  11. #endif
  12. #else
  13. char CHECK_SHARED_FUNCTION_EXISTS();
  14. #endif
  15. #ifdef __CLASSIC_C__
  16. int main(){
  17. int ac;
  18. char*av[];
  19. #else
  20. int main(int ac, char*av[]){
  21. #endif
  22. CHECK_SHARED_FUNCTION_EXISTS(CALLSTACK);
  23. if(ac > 1000)
  24. {
  25. return *av[0];
  26. }
  27. return 0;
  28. }
  29. #else /* CHECK_SHARED_FUNCTION_EXISTS */
  30. # error "CHECK_SHARED_FUNCTION_EXISTS has to specify the function"
  31. #endif /* CHECK_SHARED_FUNCTION_EXISTS */