June 6th, 2009, 05:51 AM
Visual Studio macros
I want to ask a few questions about some of the macros Visual Studio 2008 defines.
I see that VS always defines _WIN32. I can't find it anywhere in my project settings. Where is this defined?
In contrast to _WIN32, in my project settings I see that WIN32 is also defined. Now I can see in the Windows API header files that they use _WIN32, but I do not see WIN32. Why do they define WIN32 and where is it used?
When I setup a project for X64 compilation as described here (Configure Visual C++ Projects to Target 64-Bit Platforms), I expect _WIN64 to be defined as it states something to that effect in the Windows API documentation. However, _WIN64 is not defined. Is there some project settings I need to check or is this a bug?
Taking into account the above issues, I probably need to define _WIN64 myself if it is a bug. Where is the best place to do this? In the project settings (e.g /D _WIN64) or in header files with #ifndef?
Also, since the default Win32 project settings define WIN32, do I need to define bith _WIN64 and WIN64?
Click Here to Expand Forum to Full Width