All code I've seen that uses this will have something like:
Code:
#if __x86_64__
typedef long int int64;
#else
typedef long long int int64;
#endif
Obviously there may be more variants of processors, either combined into a single #if, or using a #if/#elsif/#else branch-tree.
You can of course also have different include files for different architectures, so you have a "i386/types.h", "x86_64/types.h", "ppc32/types.h", "ppc64/types.h", "arm/types.h", etc, etc.
If you are just starting on a project, you may want to just define the types once, and then let it be a future problem to solve the actual "how to we make this work for multiple architectures".
But as stated above, there is no "one solution works for everything" - since different processor architectures and compilers have different "ideas" about what is what size.
--
Mats