The documentation for MSVC's Predefined Macros state "_M_X64
[is] Defined for x64 processors." What does that mean, exactly? Will it be defined:
Specifically, I'm looking for a compiler switch for the former case, not the latter. Will _M_X64
suffice for that purpose?
Predefined Macros in C99 standard:It is used to test whether a header is compiled by a C compiler or a C++ compiler. This macro gives value similar to __STDC_VERSION__, in that it expands to a version number. __OBJC__ Macro:: __OBJC__ Macro has value 1 if the Objective-C compiler is in use.
The _M_X64 macro is always defined by any of the compilers that generate x64 code. You simple use the 32-bit compiler to generate x86 code.
Show activity on this post. _MSC_VER is (and always should be) defined when compiling with the Microsoft compiler so that it "evaluates to the major and minor number components of the compiler's version number".
Predefined MacrosA string containing the current date. A string containing the file name. An integer representing the current line number. If follows ANSI standard C, then the value is a nonzero integer.
It means that _M_X64 is the target processor. It is what you are building for, not what you are building on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With