1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-18 11:03:50 +01:00

CODING_CONVENTION.md: migrate to #pragma once

This commit is contained in:
Mikolai Gütschow 2025-04-07 11:36:11 +02:00
parent 3b6d95fa66
commit 357a37cc28
No known key found for this signature in database
GPG Key ID: 943E2F37AA659AD5

View File

@ -311,7 +311,9 @@ is considered as unused. To avoid this, one should add
## Header Guards
All files are required to have header guards of the form
All header files are required to either contain the widely supported `#pragma once`
preprocessor directive as the first line after the [copyright note](#documentation),
or header guards of the form
```c
#ifndef PATH_TO_FILE_FILENAME_H
@ -321,6 +323,9 @@ All files are required to have header guards of the form
#endif /* PATH_TO_FILE_FILENAME_H */
```
Header guards are deprecated in RIOT header files and will gradually be converted
to `#pragma once`.
Rules for generating the guard name:
1. take the file name