File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,25 @@ rewritten to comply with these rules.
263
263
codebase but should not be refactored, unless larger refactoring around that
264
264
code is taking place.
265
265
266
+ ## C Headers
267
+
268
+ 1. Include only the headers (`*.h`) that are really needed. Consider
269
+ using [iwyu](https: //include-what-you-use.org /).
270
+
271
+ 1. Use forward declarations to eliminate `#include` directives if
272
+ possible.
273
+
274
+ 1. If some headers are needed only in some build configurations,
275
+ enclose them in the same `#if` that also guards the use of its
276
+ definitions.
277
+
278
+ 1. Each source file (`*.c`) should include its own header file first
279
+ to ensure that the header ' s `#includes` are complete.
280
+
281
+ 1. Header inclusions are ordered this way: its own header first, then
282
+ PHP headers, then third-party library headers, then system headers
283
+ (e.g. libc, POSIX).
284
+
266
285
## Testing
267
286
268
287
1. Extensions should be well tested using `*.phpt` tests. Read more at
You can’t perform that action at this time.
0 commit comments