Some marcos like WIN32/_WIN32 and WIN64/_WIN64 are used by VC++. I am not sure what's the difference between WIN32/WIN64 and _WIN32/_WIN64.
Lakamraju Raghuram wrote:
I think you have't fully understood that article.
When you are copying win32 settings to x64, that article clearly mentioned to change win32 switch to win64 for /D switch
Refering to the artical, the WIN32 macro should be repalced by WIN64 with /D switch support. But after I did it under the steps, the WIN32 macro still there but not replaced by WIN64. You may try it from your side. So I am confused by the result.I wonder if it is a defect of vs2008 IDE. Some other articals mentioned that the WIN32 macro always should be set with /D switch and with WIN64 macro definied for x64 application perspectively.
Lakamraju Raghuram wrote:
Which source code? your code or in any of the standard headers?
If it is yours, then you should take care to propely to map these settings to win32 and win64 pre-processor definitions
I found the _WIN64 macro in MFC header file of basestd.h. Here a code snap:
#if defined(_WIN64)
typedef __int64 INT_PTR, *PINT_PTR;
typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
typedef \_\_int64 LONG\_PTR, \*PLONG\_PTR;
typedef unsigned \_\_int64 ULONG\_PTR, \*PULONG\_PTR;
#define \_\_int3264 \_\_int64
#else
typedef _W64 int INT_PTR, *PINT_PTR;
typedef _W64 unsigned int UINT_PTR, *PUINT_PTR;
typedef \_W64 long LONG\_PTR, \*PLONG\_PTR;
typedef \_W64 unsigned long ULONG\_PTR, \*PULONG\_PTR;
#define \_\_int3264 \_\_int32
#endif
So I am not sure which macro I should set in the preprocessor definition setting. By default, VS2008 IDE set the WIN32 macro with /D switch. Also I found _WIN32 macro is used in the MFC header files and source files.