[Xcb] Win32 port - pls review

Josh Triplett josh at joshtriplett.org
Wed Mar 31 09:12:50 PDT 2010


On Wed, Mar 31, 2010 at 11:29:58AM +0300, Rémi Denis-Courmont wrote:
> On Wednesday 31 March 2010 10:51:30 Barton C Massey, you wrote:
> > Folks have been
> > using _FILENAME_H to wrap include files for literally as
> > long as I can remember.
> 
> Folks do that because standard C headers do that. But standard C headers are 
> part of the C "implementation", so they are allowed to use reserved 
> identifiers.
> 
> > What does the standard "reserve" these names for, anyway?
> 
> I guess it's intended for:
> - linker name mangling,
> - "internal" exported functions of the C run-time.

C uses these names for expansions of the spec, to avoid conflict with
user programs.  For instance, C99 defined the new bool type as _Bool,
and stdbool.h defines bool as _Bool.  So if you don't include the new
header, and don't use names that start with _[A-Z], your code won't
break with new C standards.

C reserves _[A-Z].* and any name containing two adjacent underscores
anywhere.

Personally, I just drop the leading underscore and use FILENAME_H as the
guard symbol.

- Josh Triplett


More information about the Xcb mailing list