From: Ondřej Surý Date: Fri, 8 Mar 2019 14:38:07 +0000 (+0100) Subject: Update dev documentation to explicitly mention that #include should not... X-Git-Tag: v9.15.0~106^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=2621db706efb466ea54f105db8c2b0df113bcee3;p=thirdparty%2Fbind9.git Update dev documentation to explicitly mention that #include should not be used --- diff --git a/doc/dev/style.md b/doc/dev/style.md index 89a6b506a46..b3a7d26a0ed 100644 --- a/doc/dev/style.md +++ b/doc/dev/style.md @@ -125,6 +125,10 @@ The following lint and lint-like comments should be used where appropriate: should prevent multiple inclusion. The OS is assumed to prevent multiple inclusion of its .h files. +The `#pragma once` directive should be used instead of `#ifdef/#define` +combo, and the `#include ` should not be used anywhere, the +build system ensures that it's the first included file. + A header file defining a public interface is generally placed in the source tree two levels below the C file that implements the interface. For example, the include file defining the interface for `lib/dns/zone.c` is in @@ -155,8 +159,7 @@ or for public files that do not declare any functions. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - #ifndef ISC_WHATEVER_H - #define ISC_WHATEVER_H 1 + #pragma once /***** ***** Module Info