How can I detect if I'm compiling for a 64bits architecture in C++

前端 未结 8 1668
难免孤独
难免孤独 2020-12-29 23:07

In a C++ function I need the compiler to choose a different block if it is compiling for a 64 bit architecture.

I know a way to do it for MSVC++ and g++, so I\'ll po

相关标签:
8条回答
  • 2020-12-29 23:29
    #ifdef _LP64
    

    Works on both platforms

    0 讨论(0)
  • 2020-12-29 23:33

    Raymond covers this.

    0 讨论(0)
提交回复
热议问题