This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] 编译器/TMS320F28335:如何检测 C 代码中的编译器版本?

Guru**** 2952510 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/955625/compiler-tms320f28335-how-to-detect-compiler-version-in-c-codes

器件型号:TMS320F28335

工具/软件:TI C/C++编译器

尊敬的香榭丽舍

我向我们的客户提出这一问题。

用户如何在 C 代码中检查编译器版本?

比如

#if defined (__GNU__)

   (笑声)

#elif defined (__TI_C2000__)   <--如何检测是否使用了 C2000编译器。

   (笑声)

#endif

黄维恩