A useful resource on how to detect compilation environment based on predefined macros :
Other ressource : https://sourceforge.net/p/predef/wiki/Compilers/.
echo | g++ -dM -E - | more
can be used (g++
can be replaced by other g(cc|++)-like compiler.
echo | em++ …
) displays macros which are stripped out. The __x86_64__
macro, for example.