This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How can I differentiate C and C++ compiler?


On Thu, 8 Oct 2009, Dr. David Kirkby wrote:

I want a user to set environment variables CC and CXX and point them to C and C++ compilers. I want to check that they are in fact C and C++ compilers, and that CC does not point to a C++ compiler, and CXX does not point to a C compiler.

Just test if it defines __cplusplus. Bonus: it works the same for any compiler.


--
Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]