diff options
Diffstat (limited to 'doc/manual')
-rw-r--r-- | doc/manual/style.txt | 19 |
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 |