This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How can I differentiate C and C++ compiler?
- From: Marc Glisse <marc dot glisse at normalesup dot org>
- To: "Dr. David Kirkby" <david dot kirkby at onetel dot net>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 8 Oct 2009 14:57:32 +0200 (CEST)
- Subject: Re: How can I differentiate C and C++ compiler?
- References: <4ACDDABE.20903@onetel.net>
- Reply-to: gcc-help at gcc dot gnu dot org
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