I use clang
, gcc
, and tcc
, and I'd like to be able to differentiate between the three in a common header.
Judging by their macro dumps, I expect that the presence of the
__clang__
macro will uniquely identify clang.
I'm unable to get a macro dump with tcc
( $compiler -x c -E -dM /dev/null
doesn't work in its case ).
What is the macro(s) (if any) that will uniquely identify gcc (and possibly tcc)?
Use __TINYC__ to detect tcc1.
Detection of gcc and clang is explained in this StackOverflow question: Detect gcc as opposed to msvc / clang with macro
1 (Quoted from: http://bellard.org/tcc/tcc-doc.html#SEC9)
__TINYC__ is a predefined macro to 1 to indicate that you use TCC.
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