Specific difference between _WIN64 and TARGET_X64 macros in Visual Studio

2.8k views Asked by At

Most of the time _WIN64 macro was working well with Microsoft Visual Studio 2008 but TARGET_X64 not working well.Please explain these two macros with specific example.

1

There are 1 answers

7
James McNellis On BEST ANSWER

The Visual C++ compiler predefines _WIN64 when compiling for a 64-bit target. To test for x64/amd64 specifically, test for _M_X64 instead. Consult the documentation for other macros that are predefined by the compiler.

TARGET_X64 is defined by neither the Windows SDK nor the Visual C++ libraries or toolchain. It must be defined somewhere else in your project or one of its dependencies.