This is the mail archive of the gcc-patches@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: Patch: Use tm_defines to configure default scheduling model on PA


> > I still think it better to put the defines first because the headers
> > may contain secondary defines based on the identifier that you want
> > to redefine.
> 
> Consider, for example, this from i386/cygwin.h:
> 
> /* For Win32 ABI compatibility */
> #undef DEFAULT_PCC_STRUCT_RETURN
> #define DEFAULT_PCC_STRUCT_RETURN 0
> 
> To do this with defines before includes, you'd need to put a #ifdef
> around *every single* define in *every* header file, because you won't
> know which will be overridden by targets.

Yes.  However, it's not reasonable to define the entire cygwin configuration
in configure.  If configure checked how to define DEFAULT_PCC_STRUCT_RETURN
then I would say it has a place in configure, and that there should be
a way independent of include files to override the default define.  I
agree that in some cases putting the defines after the headers is simpler
and avoids the ifdef burden, however you loose some flexibility in what
the headers can do.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


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