开发者

Is there any way I can tell if my code is being compiled with cl.exe?

开发者 https://www.devze.com 2023-02-23 08:20 出处:网络
This has probably been asked before, but I couldn\'t find it. Is there a way to determine, at compile time, if my code is being compiled by cl.exe?

This has probably been asked before, but I couldn't find it.

Is there a way to determine, at compile time, if my code is being compiled by cl.exe?

I will be using this to conditionally include (during prepr开发者_运维百科ocessing, via #ifdef) certain #pragma directives only supported by cl.exe.


If you want to make decisions on the cl.exe version, use _MSC_BUILD.

However, first check for _MSC_VER, because _MSC_BUILD was not available in VS 2005.


I think you can check for the _MSC_BUILD macro.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号