Jump to content
  • Advertisement
Sign in to follow this  
Catafriggm

Preprocessor Processor Defines

This topic is 4824 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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++?

Share this post


Link to post
Share on other sites
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_).

Share this post


Link to post
Share on other sites
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 :(

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!