diff options
author | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-04-24 21:21:12 +0200 |
---|---|---|
committer | Tim Rühsen <tim.ruehsen@gmx.de> | 2019-05-07 21:06:23 +0200 |
commit | efac5f44c41bc022b9b0b21130bd826745acef91 (patch) | |
tree | 1d6897a174f735cbe3b026dc064e56d279a29fbd /CONTRIBUTING.md | |
parent | 03e1f6430150ef19d432e56d334b0f1d2424aeaa (diff) | |
download | gnutls-efac5f44c41bc022b9b0b21130bd826745acef91.tar.gz |
Add 'Header guards' section in CONTRIBUTING.md
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e38bba321e..3a20170f6b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -115,6 +115,28 @@ They can however be used by unit tests in tests/ directory; in that case they should be part of the GNUTLS_PRIVATE_3_4 tag in libgnutls.map. +# Header guards + + Each private C header file SHOULD have a header guard consisting of the +project name and the file path relative to the project directory, all uppercase. + +Example: `lib/srp.h` uses the header guard `GNUTLS_LIB_SRP_H`. + +The header guard is used as first and last effective code in a header file, +like e.g. in lib/srp.h: + +``` +#ifndef GNUTLS_LIB_SRP_H +#define GNUTLS_LIB_SRP_H + +... + +#endif /* GNUTLS_LIB_SRP_H */ + +The public header files follow a similar convention but use the relative +install directory as template, e.g. `GNUTLS_GNUTLS_H` for `gnutls/gnutls.h`. + + # Introducing new functions / API Prior to introducing any new API consider all options to offer the same |