This is the mail archive of the
mailing list for the libstdc++ project.
Re: Names of header include guards
- From: Nathan Myers <ncm-nospam at cantrip dot org>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 21 Jul 2003 15:05:32 -0700
- Subject: Re: Names of header include guards
- References: <200307212148.OAA03688@hpsje.cup.hp.com>
On Mon, Jul 21, 2003 at 02:48:17PM -0700, Steve Ellcey wrote:
> I just ran into a problem because the include guard on the C++ ctime
> header file changed from _CPP_CTIME to _CTIME. The problem is that the
> HP header files use the macro _CTIME as a guard around the function
> ctime() and this conflicts with the g++ use of it as a file level
> include guard on the ctime header file. ...
> HP uses _XYZ_INCLUDED for a header file called xyz.h, by having the
> _INCLUDED on the end of all header file include guards it puts them in
> their own namespace (so to speak). This seems like a useful idea, any
> chance of doing something similar for gcc/g++ header files?
Yes. In fact, it would be a Good Thing to have a suffix or prefix on
the include guards that looks more or less random, to make it really
unlikely to collide with platform names. I'd welcome a patch that put
suffixes like "_EXDRJVZQIO" on all our header guard names.
This can be done incrementally, of course. If HP has a problem with
the <ctime> header, we may just patch that header first.