mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
Merge #12757: Clarify include guard naming convention
3bcc0059b8
Add lint-include-guards.sh which checks include guard consistency (practicalswift)8fd6af89a0
Fix missing or inconsistent include guards (practicalswift)8af65d96f4
Document include guard convention (practicalswift) Pull request description: * **Documentation**: Document include guard convention * **Fix**: Fix missing or inconsistent include guards * **Regression test**: Add `lint-include-guards.sh` which checks include guard consistency Tree-SHA512: 8171878f60fd08ccbea943a11e835195750592abb9d7ab74eaa4265ae7fac523b1da9d31ca13d6ab73dd596e49986bfb7593c696e5f39567c93e610165bc2acc
This commit is contained in:
@ -606,6 +606,16 @@ namespace {
|
||||
source file into account. This allows quoted includes to stand out more when
|
||||
the location of the source file actually is relevant.
|
||||
|
||||
- Use include guards to avoid the problem of double inclusion. The header file
|
||||
`foo/bar.h` should use the include guard identifier `BITCOIN_FOO_BAR_H`, e.g.
|
||||
|
||||
```c++
|
||||
#ifndef BITCOIN_FOO_BAR_H
|
||||
#define BITCOIN_FOO_BAR_H
|
||||
...
|
||||
#endif // BITCOIN_FOO_BAR_H
|
||||
```
|
||||
|
||||
GUI
|
||||
-----
|
||||
|
||||
|
Reference in New Issue
Block a user