is there a C macro or some kind of way that i can check if my c program was compiled as 64bit or 32bit at compile time in C?
Compiler: GCC Operating systems that i n
Use this UINTPTR_MAX value to check build type.
#include #include #if UINTPTR_MAX == 0xffffffffffffffffULL # define BUILD_64 1 #endif int main(void) { #ifdef BUILD_64 printf("Your Build is 64-bit\n"); #else printf("Your Build is 32-bit\n"); #endif return 0; }