#include ordering for source files
- #include <config.h> should be first, and use <> not "" (as recommended
by the autoconf manual).
- The header corresponding to the source file should be next. This means that compilation
of the library ensures that each header with a corresponding source file is "self supporting"
(i.e. it implicitly or explicitly includes all of the headers it requires).
- Not sure what's best for the rest - I don't yet have coherent arguments for a particular
ordering.
- External xapian-core headers, alphabetically. When included from other external headers,
use <> to reduce problems with finding headers in the user's source tree by mistake.
In sources and internal headers, use "" (?) - practically this makes no
difference as we have -I for srcdir and builddir, but <> suggests installed header
files so "" seems more natural).
- Internal headers, alphabetically (using "").
- "Safe" versions of library headers (include these first to avoid issues if other library
headers include the ones we want to wrap). Use "" and order alphabetically.
- Library headers, alphabetically.
- Standard C++ headers, alphabetically. Use the modern (no .h suffix) names.
Download in other formats: