Preprocessor Processor Defines

Started by
2 comments, last by Extrarius 18 years, 10 months ago
I'm trying to write a program that uses some functions in assembly. I need to have a version for x86-32, and another for x86-64 running in 64-bit mode. How can I detect which with preprocessor defines, in both VC++ and G++?
Advertisement
There might be some compiler specific flags for this, but the easiest would probably be to just add a compile time define yourself.
(i.e. g++ file.cpp -m64 -D_COMPILE_AS_64_BIT_).
I think VC++ will define WIN64 if under 64 bit windows. I read somewhere that GCC will define __LP64__, but am not sure. It'd be nice to have a list of the predefines by compiler but I have never been able to find one :(
Quote:Original post by evolutional
[...]It'd be nice to have a list of the predefines by compiler but I have never been able to find one :(


Well, you can find the MS list here
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

This topic is closed to new replies.

Advertisement