From d4b7cbff88bb5eb14fececdbd8e2a0b3e58ce6e0 Mon Sep 17 00:00:00 2001 From: Marc Schink Date: Mon, 21 Sep 2015 21:07:46 +0200 Subject: Make #include guard naming consistent Change-Id: Ie13e8af0bb74ed290f811dcad64ad06c9d8cb4fa Signed-off-by: Marc Schink Reviewed-on: http://openocd.zylin.com/2956 Tested-by: jenkins Reviewed-by: Andreas Fritiofson --- doc/manual/style.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc') 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 -- cgit v1.1