summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-07 21:02:58 +0100
committerwm4 <wm4@nowhere>2019-11-07 22:53:13 +0100
commit573673e6aa0a9562433882f14a46ae0b249d0e10 (patch)
tree0b2ffc90a742ddfb70e034980fd451d6efce437f
parentafbddbdf8fbf30d13f12d51c065b68fafc6584a4 (diff)
downloadmpv-573673e6aa0a9562433882f14a46ae0b249d0e10.tar.bz2
mpv-573673e6aa0a9562433882f14a46ae0b249d0e10.tar.xz
DOCS/contribute.md: add #include order to coding style
Another thing nobody will read, or consciously follow.
-rw-r--r--DOCS/contribute.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/DOCS/contribute.md b/DOCS/contribute.md
index 37987cf96b..8e20e64f43 100644
--- a/DOCS/contribute.md
+++ b/DOCS/contribute.md
@@ -185,6 +185,17 @@ mpv uses C99 with K&R formatting, with some exceptions.
- Remove any trailing whitespace.
- Do not make stray whitespaces changes.
+Header #include statement order
+-------------------------------
+
+The order of ``#include`` statements in the source code is not very consistent.
+New code should follow the following conventions:
+
+- Put standard includes (``#include <stdlib.h>`` etc.) on the top,
+- then after a blank line, add library includes (``#include <zlib.h`` etc.)
+- then after a blank line, add internal includes (``#include "player/core.h"``)
+- sort them alphabetically within these sections
+
General coding
--------------