aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMarc Schink <openocd-dev@marcschink.de>2015-09-21 21:07:46 +0200
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2016-05-24 22:30:55 +0100
commitd4b7cbff88bb5eb14fececdbd8e2a0b3e58ce6e0 (patch)
tree78f8488d823e6abc4774529de947572e955a525e /doc
parentd0e763ac7ef6aa17b17bd00ccdfbccfb4eacda69 (diff)
downloadriscv-openocd-d4b7cbff88bb5eb14fececdbd8e2a0b3e58ce6e0.zip
riscv-openocd-d4b7cbff88bb5eb14fececdbd8e2a0b3e58ce6e0.tar.gz
riscv-openocd-d4b7cbff88bb5eb14fececdbd8e2a0b3e58ce6e0.tar.bz2
Make #include guard naming consistent
Change-Id: Ie13e8af0bb74ed290f811dcad64ad06c9d8cb4fa Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/2956 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/manual/style.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/manual/style.txt b/doc/manual/style.txt
index 54c1342..2ff2a29 100644
--- a/doc/manual/style.txt
+++ b/doc/manual/style.txt
@@ -72,6 +72,25 @@ Finally, try to avoid lines of code that are longer than than 72-80 columns:
- use underline characters between consecutive words in identifiers
(e.g. @c more_than_one_word).
+@section style_include_guards Include Guards
+
+Every header file should have a unique include guard to prevent multiple
+inclusion.
+To guarantee uniqueness, an include guard should be based on the filename and
+the full path in the project source tree.
+
+For the header file src/helper/jim-nvp.h, the include guard would look like
+this:
+
+@code
+#ifndef OPENOCD_HELPER_JIM_NVP_H
+#define OPENOCD_HELPER_JIM_NVP_H
+
+/* Your code here. */
+
+#endif /* OPENOCD_HELPER_JIM_NVP_H */
+@endcode
+
@section stylec99 C99 Rules
- inline functions