How to Detect if I'm Compiling Code with a par

2019-01-02 18:55发布

Is there any way to know if I'm compiling under a specific Microsoft Visual Studio version?

7条回答
与风俱净
2楼-- · 2019-01-02 19:52

_MSC_VER should be defined to a specific version number. You can either #ifdef on it, or you can use the actual define and do a runtime test. (If for some reason you wanted to run different code based on what compiler it was compiled with? Yeah, probably you were looking for the #ifdef. :))

查看更多
登录 后发表回答