[PATCH][1/1] - Xserver - XTrap prep sources for config.h inclusion

Daniel Stone daniel at fooishbar.org
Tue Apr 19 06:10:38 PDT 2005


On Tue, Apr 19, 2005 at 12:55:17PM +0200, GOMBAS Gabor wrote:
> On Tue, Apr 19, 2005 at 05:57:59PM +1000, Daniel Stone wrote:
> > Depends if they're internal or external headers.  But even if they're
> > external, it'd be unlikely to do any harm.  That being said, it's not
> > the best of ideas that you should do it unless you need to.
> 
> #including <config.h> from external headers _is_ extremely harmful:
> 
> 1. All projects that do not use autoconf will break if they try to use
>    that header file
> 2. Even if config.h is provided by the project wanting to include the
>    header, it's contents will be completely different from what the
>    header expects (even the _meaning_ of the very same macro being
>    defined/undefined might be different)
> 
> Please do not include <config.h> from any external header. In fact, the
> best practice is not to include <config.h> from _any_ header at all,
> include it only from source (.c, .cpp etc.) files.

I never said it was a good idea.  But the likelihood of someone else's
config.h defining XFree86LOADER, _SYNC_SERVER, or such, is rather low.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.x.org/archives/xorg-modular/attachments/20050419/69d29ac0/attachment.pgp


More information about the xorg-modular mailing list