[webkit-dev] What's the rationale for not including config.h in any header files?

Michael Catanzaro mcatanzaro at igalia.com
Mon Jul 31 14:04:03 PDT 2017


On Mon, Jul 31, 2017 at 9:27 PM, Darin Adler <darin at apple.com> wrote:
> I don’t think we should add lots of includes of “config.h”, 
> though. I think we can come up with something better.

Like what? The only alternative is to pass defines as preprocessor 
flags via -D. Our command lines are already hard enough to read as it 
is. Or, well, we could include config.h in Platform.h, where the 
ENABLE/USE series of macros are defined.

I'm curious as to why including config.h in the header file would break 
Autotools builds. I don't see why that would be the case. As far as I 
know, it just happens to be common practice to include config.h only in 
source files. It's special: you always include it first in source files 
to avoid extremely confusing bugs that can result from not doing so, 
and therefore it seems redundant to put it in header files.

I wonder how other projects (and other IDEs, e.g. XCode) handle this 
situation. Anyway, I don't have a strong opinion either way....

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20170731/19f02772/attachment.html>


More information about the webkit-dev mailing list