CheckTypeSize.c.in 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. @headers@
  2. #undef KEY
  3. #if defined(__i386)
  4. # define KEY '_','_','i','3','8','6'
  5. #elif defined(__x86_64)
  6. # define KEY '_','_','x','8','6','_','6','4'
  7. #elif defined(__ppc__)
  8. # define KEY '_','_','p','p','c','_','_'
  9. #elif defined(__ppc64__)
  10. # define KEY '_','_','p','p','c','6','4','_','_'
  11. #elif defined(__aarch64__)
  12. # define KEY '_','_','a','a','r','c','h','6','4','_','_'
  13. #elif defined(__ARM_ARCH_7A__)
  14. # define KEY '_','_','A','R','M','_','A','R','C','H','_','7','A','_','_'
  15. #elif defined(__ARM_ARCH_7S__)
  16. # define KEY '_','_','A','R','M','_','A','R','C','H','_','7','S','_','_'
  17. #endif
  18. #define SIZE (sizeof(@type@))
  19. char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
  20. ('0' + ((SIZE / 10000)%10)),
  21. ('0' + ((SIZE / 1000)%10)),
  22. ('0' + ((SIZE / 100)%10)),
  23. ('0' + ((SIZE / 10)%10)),
  24. ('0' + (SIZE % 10)),
  25. ']',
  26. #ifdef KEY
  27. ' ','k','e','y','[', KEY, ']',
  28. #endif
  29. '\0'};
  30. #ifdef __CLASSIC_C__
  31. int main(argc, argv) int argc; char *argv[];
  32. #else
  33. int main(int argc, char *argv[])
  34. #endif
  35. {
  36. int require = 0;
  37. require += info_size[argc];
  38. (void)argv;
  39. return require;
  40. }