This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: Names of header include guards


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.

Nathan Myers
ncm-nospam@cantrip.org


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