Guest User

Machine.h

a guest
Jun 25th, 2025
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | Source Code | 0 0
  1. #pragma once
  2.  
  3. #include <stdint.h>
  4.  
  5. // Machine pointer size detection
  6.  
  7. #if (UINTPTR_MAX == UINT32_MAX)
  8. #define MACHINE_PTR32 1
  9. #elif (UINTPTR_MAX == UINT64_MAX)
  10. #define MACHINE_PTR64 1
  11. #endif
  12.  
  13. // Machine architecture detection
  14.  
  15. #ifdef _MSC_VER
  16.     #ifdef _M_IX86
  17. #define MACHINE_IA32 1
  18.     #elif _M_X64
  19. #define MACHINE_AMD64 1
  20.     #elif _M_ARM
  21. #define MACHINE_ARM32 1
  22.     #elif _M_ARM64
  23. #define MACHINE_ARM64 1
  24.     #endif
  25. #elif __GNUC__
  26.     #ifdef __i386__
  27. #define MACHINE_IA32 1
  28.     #elif __x86_64__
  29. #define MACHINE_AMD64 1
  30.     #elif __arm__
  31. #define MACHINE_ARM32 1
  32.     #elif __aarch64__
  33. #define MACHINE_ARM64 1
  34.     #endif
  35. #endif
  36.  
  37.  
Advertisement
Add Comment
Please, Sign In to add comment