﻿# Using \_WIN64/WIN64 macros

The \_WIN64 macro will be always predefined by the compiler itself while building for any 64\-bit Windows family OS, so this macro should not ever be defined manually\. It's worth noting that \_WIN64 is defined by the compiler regardless of the 64\-bit architecture being used \(as for the x64 or IA64\), so in case it is necessary to write a platform\-specific code, the M\_IA64 or \_M\_AMD64 macros should be used instead\. \_WIN64 also could be defined together with \_WIN32 if there is a need to use Win32 API inside the 64\-bit build\.

The WIN64 macro is not a part of Visual C\+\+ standard predefined macros and it is not utilized anywhere inside of VC\+\+ system include files, as such it can be manually defined anywhere in the code\. Quite often this macro is utilized by third\-party developers to distinguish the versions of their own APIs\.

## References

1. Visual Studio vNext Forums\. [64 bit Compiler\.](https://social.msdn.microsoft.com/Forums/vstudio/en-US/b09929e7-ef2f-40c4-9d25-bd6bb7adf8e9/64-bit-compiler?forum=vcgeneral)
1. MSDN Library\. [Predefined Macros\.](https://msdn.microsoft.com/en-us/library/b0084kay(v=VS.100).aspx)
1. Knowledge Base\. [How to check if a 64\-bit project is being built in Visual Studio using \#ifdef](https://pvs-studio.com/en/blog/posts/k0032/)\.