Detecting 64bit compile in C
Here is the correct and portable test which does not assume x86 or anything else:
#include <stdint.h>
#if UINTPTR_MAX == 0xffffffff
/* 32-bit */
#elif UINTPTR_MAX == 0xffffffffffffffff
/* 64-bit */
#else
/* wtf */
#endif
Since you tagged this "gcc", try
#if __x86_64__
/* 64-bit */
#endif