Compiler version, name, and OS detection in C++

前端 未结 4 1435
感动是毒
感动是毒 2021-01-03 05:57

I need to detect the OS name, compiler name, and version of the compiler with C++, as I need to change the setup for each case.

How can I do that?

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-03 06:17

    I recommend define platform in build scripts by providing -D_i386 -DENDIAN=1234 -D_linux. But if you still think another predef project is your friend:

    http://sourceforge.net/apps/mediawiki/predef/index.php?title=Main_Page

提交回复
热议问题