Search code examples
c++cvisual-studio-2010visual-c++64-bit

Is there a #define for 64 bit in Visual Studio 2010?


Is there a #define that indicates whether Visual Studio is compiling in 64bit mode? I'd like to be able to include some code conditionally like so

#ifdef _IS_64BIT
  ...
#else //32 bit
  ...
#endif

I know I can create a flag myself, but I'm wondering if the compiler provides one.


Solution

  • #ifdef _WIN64
      ...
    #else
      ...
    #endif
    

    Documented on Microsoft docs