This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: G++ defining _GNU_SOURCE
- To: pedwards at disaster dot jaj dot com (Phil Edwards)
- Subject: Re: G++ defining _GNU_SOURCE
- From: Joern Rennecke <amylaar at redhat dot com>
- Date: Wed, 20 Jun 2001 18:36:05 +0100 (BST)
- Cc: mark at codesourcery dot com (Mark Mitchell), gcc at gcc dot gnu dot org
> (can't think of an easy way for linux.h to simply "prepend" -D_GNU_SOURCE
> to a previously-defined possibly empty CPLUSPLUS_CPP_DEFINE, rather than
> undef'ing it and fully redefining it.)
You can introduce a SUBTARGET_CPLUSPLUS_CPP_DEFINE, which defailts to empty
in pa.h, and is redefined in linux.h as "-D_GNU_SOURCE" .
You'd have to list SUBTARGET_CPLUSPLUS_CPP_DEFINE in EXTRA_SPECS.
For an example how such a thing is done, look at SUBTARGET_CPP_SPEC
in mips/config directory. For an example how it is *not* done, look
at SUBTARGET_CPP_PREDEFINES in config/mcore ;-)