[asterisk-dev] header inclusion policy ?

Kevin P. Fleming kpfleming at digium.com
Fri Mar 24 21:27:54 MST 2006


Luigi Rizzo wrote:

> i hope you are aware that this 'optimization' has absolutely
> no impact on the object code that is produced, only on the
> compile times (which are not huge, anyways... and with those monster
> 5-10k source files that we have, it's not a few extra headers that
> change things).

Yes... optimization in this case refers to compile times, and (as
another poster mentioned), excess rebuilds when header files are modified.

> the "asterisk/platform.h" will most likely end up including
> a lot of system headers to cover the prerequisites for
> the other #include's in regular files...

I believe that is fine... let's hide all the system header complexity in
a single file, then let the modules include the Asterisk-specific
headers (or external library headers) that they need. It may even be
possible to use gcc's 'precompiled header' functionality for this
header, although that's not likely to make a large difference.

I'll be happy to update the coding guidelines document once we have the
'master' header file in place so there are examples to put in there.



More information about the asterisk-dev mailing list