CheckTypeSize.c 549 B

123456789101112131415161718192021222324252627282930
  1. #ifdef CHECK_TYPE_SIZE_TYPE
  2. #ifdef HAVE_SYS_TYPES_H
  3. # include <sys/types.h>
  4. #endif /* HAVE_SYS_TYPES_H */
  5. #ifdef HAVE_STDINT_H
  6. # include <stdint.h>
  7. #endif /* HAVE_STDINT_H */
  8. #ifdef HAVE_STDDEF_H
  9. # include <stddef.h>
  10. #endif /* HAVE_STDDEF_H */
  11. #ifdef __CLASSIC_C__
  12. int main(){
  13. int ac;
  14. char*av[];
  15. #else
  16. int main(int ac, char*av[]){
  17. #endif
  18. if(ac > 1000){return *av[0];}
  19. return sizeof(CHECK_TYPE_SIZE_TYPE);
  20. }
  21. #else /* CHECK_TYPE_SIZE_TYPE */
  22. # error "CHECK_TYPE_SIZE_TYPE has to specify the type"
  23. #endif /* CHECK_TYPE_SIZE_TYPE */