Skip to content

Commit 6f23791

Browse files
authored
Merge pull request #21517 from KSKNico/fix-examples-headers
examples: replace header guards with #pragma once
2 parents 6fc81ad + a28a905 commit 6f23791

File tree

11 files changed

+22
-50
lines changed

11 files changed

+22
-50
lines changed

examples/advanced/psa_crypto/custom_atca_params.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* directory for more details.
77
*/
88

9+
#pragma once
10+
911
/**
1012
* @ingroup examples
1113
* @{
@@ -17,9 +19,6 @@
1719
* @author Lena Boeckmann <[email protected]>
1820
*
1921
*/
20-
#ifndef CUSTOM_ATCA_PARAMS_H
21-
#define CUSTOM_ATCA_PARAMS_H
22-
2322
#include "cryptoauthlib.h"
2423
#include "psa/crypto.h"
2524

@@ -121,5 +120,4 @@ extern "C" {
121120
}
122121
#endif
123122

124-
#endif /* CUSTOM_ATCA_PARAMS_H */
125123
/** @} */

examples/advanced/twr_aloha/control.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* directory for more details.
77
*/
88

9+
#pragma once
10+
911
/**
1012
* @ingroup examples
1113
* @{
@@ -17,9 +19,6 @@
1719
* @}
1820
*/
1921

20-
#ifndef CONTROL_H
21-
#define CONTROL_H
22-
2322
#ifdef __cplusplus
2423
extern "C" {
2524
#endif
@@ -115,5 +114,3 @@ uint32_t uwb_core_rng_req_remaining(void);
115114
#ifdef __cplusplus
116115
}
117116
#endif
118-
119-
#endif /* CONTROL_H */

examples/lang_support/official/riot_and_cpp/c_functions.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* directory for more details.
77
*/
88

9+
#pragma once
10+
911
/**
1012
* @ingroup examples
1113
* @{
@@ -19,9 +21,6 @@
1921

2022
#include <stdio.h>
2123

22-
#ifndef C_FUNCTIONS_H
23-
#define C_FUNCTIONS_H
24-
2524
/*
2625
* all headers defining c functions must be marked as extern "C" when included
2726
* into c++ sources
@@ -51,4 +50,3 @@ int day_of_week(int day, int month, int year);
5150
#endif
5251

5352
/** @} */
54-
#endif /* C_FUNCTIONS_H */

examples/lang_support/official/riot_and_cpp/cpp_class.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* directory for more details.
88
*/
99

10+
#pragma once
11+
1012
/**
1113
* @defgroup
1214
* @brief
@@ -20,9 +22,6 @@
2022
* @author DangNhat Pham-Huu <[email protected]>
2123
*/
2224

23-
#ifndef CPP_CLASS_H
24-
#define CPP_CLASS_H
25-
2625
#include <cstdio>
2726

2827
class cpp_class
@@ -60,4 +59,3 @@ class cpp_class
6059
};
6160

6261
/** @} */
63-
#endif /* CPP_CLASS_H */

examples/networking/coap/gcoap/gcoap_example.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* details.
77
*/
88

9+
#pragma once
10+
911
/**
1012
* @ingroup examples
1113
* @{
@@ -16,9 +18,6 @@
1618
* @author Ken Bannister <[email protected]>
1719
*/
1820

19-
#ifndef GCOAP_EXAMPLE_H
20-
#define GCOAP_EXAMPLE_H
21-
2221
#include <stdint.h>
2322
#include <stdio.h>
2423
#include <stdlib.h>
@@ -53,5 +52,4 @@ void notify_observers(void);
5352
}
5453
#endif
5554

56-
#endif /* GCOAP_EXAMPLE_H */
5755
/** @} */

examples/networking/coap/gcoap_dtls/gcoap_example.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* details.
77
*/
88

9+
#pragma once
10+
911
/**
1012
* @ingroup examples
1113
* @{
@@ -16,9 +18,6 @@
1618
* @author Ken Bannister <[email protected]>
1719
*/
1820

19-
#ifndef GCOAP_EXAMPLE_H
20-
#define GCOAP_EXAMPLE_H
21-
2221
#include <stdint.h>
2322
#include <stdio.h>
2423
#include <stdlib.h>
@@ -53,5 +52,4 @@ void notify_observers(void);
5352
}
5453
#endif
5554

56-
#endif /* GCOAP_EXAMPLE_H */
5755
/** @} */

examples/networking/coap/gcoap_dtls/tinydtls_keys.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* directory for more details.
77
*/
88

9+
#pragma once
10+
911
/**
1012
* @ingroup examples
1113
* @{
@@ -18,9 +20,6 @@
1820
* @}
1921
*/
2022

21-
#ifndef TINYDTLS_KEYS_H
22-
#define TINYDTLS_KEYS_H
23-
2423
#ifdef __cplusplus
2524
extern "C" {
2625
#endif
@@ -59,5 +58,3 @@ static const unsigned char ecdsa_pub_key_y[] = {
5958
#ifdef __cplusplus
6059
}
6160
#endif
62-
63-
#endif /* TINYDTLS_KEYS_H */

examples/networking/dtls/dtls-echo/tinydtls_keys.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* directory for more details.
77
*/
88

9+
#pragma once
10+
911
/**
1012
* @ingroup examples
1113
* @{
@@ -18,9 +20,6 @@
1820
* @}
1921
*/
2022

21-
#ifndef TINYDTLS_KEYS_H
22-
#define TINYDTLS_KEYS_H
23-
2423
#ifdef __cplusplus
2524
extern "C" {
2625
#endif
@@ -62,5 +61,3 @@ static const unsigned char ecdsa_pub_key_y[] = {
6261
#ifdef __cplusplus
6362
}
6463
#endif
65-
66-
#endif /* TINYDTLS_KEYS_H */

examples/networking/dtls/dtls-sock/dtls_client_credentials.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* directory for more details.
77
*/
88

9+
#pragma once
10+
911
/**
1012
* @ingroup examples
1113
* @{
@@ -18,9 +20,6 @@
1820
* @}
1921
*/
2022

21-
#ifndef DTLS_CLIENT_CREDENTIALS_H
22-
#define DTLS_CLIENT_CREDENTIALS_H
23-
2423
#ifdef __cplusplus
2524
extern "C" {
2625
#endif
@@ -135,5 +134,3 @@ static const unsigned char known_server_public_key_1_y[] = {
135134
#ifdef __cplusplus
136135
}
137136
#endif
138-
139-
#endif /* DTLS_CLIENT_CREDENTIALS_H */

examples/networking/dtls/dtls-sock/dtls_server_credentials.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* directory for more details.
77
*/
88

9+
#pragma once
10+
911
/**
1012
* @ingroup examples
1113
* @{
@@ -18,9 +20,6 @@
1820
* @}
1921
*/
2022

21-
#ifndef DTLS_SERVER_CREDENTIALS_H
22-
#define DTLS_SERVER_CREDENTIALS_H
23-
2423
#ifdef __cplusplus
2524
extern "C" {
2625
#endif
@@ -131,5 +130,3 @@ static const unsigned char known_client_public_key_0_y[] = {
131130
#ifdef __cplusplus
132131
}
133132
#endif
134-
135-
#endif /* DTLS_SERVER_CREDENTIALS_H */

0 commit comments

Comments
 (0)