diff --git a/core/include/cond.h b/core/include/cond.h index 4db672d940..ee1237d9fa 100644 --- a/core/include/cond.h +++ b/core/include/cond.h @@ -4,6 +4,8 @@ * directory for more details. */ +#pragma once + /** * @defgroup core_sync_cond Condition Variable * @ingroup core_sync @@ -134,9 +136,6 @@ * @author Sam Kumar */ -#ifndef COND_H -#define COND_H - #include #include @@ -211,5 +210,4 @@ void cond_broadcast(cond_t *cond); } #endif -#endif /* COND_H */ /** @} */ diff --git a/core/include/mbox.h b/core/include/mbox.h index 121b9ae65a..aa12657998 100644 --- a/core/include/mbox.h +++ b/core/include/mbox.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @defgroup core_mbox Mailboxes * @ingroup core @@ -19,9 +21,6 @@ * @author Kaspar Schleiser */ -#ifndef MBOX_H -#define MBOX_H - #include "list.h" #include "cib.h" #include "msg.h" @@ -201,4 +200,3 @@ static inline void mbox_unset(mbox_t *mbox) #endif /** @} */ -#endif /* MBOX_H */ diff --git a/core/include/msg.h b/core/include/msg.h index f934c49f07..758a6ca6a6 100644 --- a/core/include/msg.h +++ b/core/include/msg.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @defgroup core_msg Messaging / IPC * @ingroup core @@ -173,9 +175,6 @@ * @author Kévin Roussel */ -#ifndef MSG_H -#define MSG_H - #include #include @@ -434,5 +433,4 @@ void msg_queue_print(void); } #endif -#endif /* MSG_H */ /** @} */ diff --git a/core/include/msg_bus.h b/core/include/msg_bus.h index ef1c29c13c..f2ed3b3a0a 100644 --- a/core/include/msg_bus.h +++ b/core/include/msg_bus.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_msg * @@ -35,9 +37,6 @@ * @author Benjamin Valentin */ -#ifndef MSG_BUS_H -#define MSG_BUS_H - #include #include @@ -264,5 +263,4 @@ static inline int msg_bus_post(msg_bus_t *bus, uint8_t type, const void *arg) } #endif -#endif /* MSG_BUS_H */ /** @} */ diff --git a/core/include/mutex.h b/core/include/mutex.h index 79781a330c..6f94e9dbc9 100644 --- a/core/include/mutex.h +++ b/core/include/mutex.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @addtogroup core_sync_mutex * @{ @@ -18,9 +20,6 @@ * @author Kaspar Schleiser */ -#ifndef MUTEX_H -#define MUTEX_H - #include #include #include @@ -349,5 +348,4 @@ void mutex_cancel(mutex_cancel_t *mc); } #endif -#endif /* MUTEX_H */ /** @} */ diff --git a/core/include/native_sched.h b/core/include/native_sched.h index 18c22191f5..6757d66e59 100644 --- a/core/include/native_sched.h +++ b/core/include/native_sched.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @defgroup core_sched_native Scheduler for native * @ingroup core_sched @@ -20,9 +22,6 @@ * @author Raphael Hiesgen */ -#ifndef NATIVE_SCHED_H -#define NATIVE_SCHED_H - #ifdef __cplusplus extern "C" { #endif @@ -64,5 +63,4 @@ extern int sched_yield(void); } #endif -#endif /* NATIVE_SCHED_H */ /** @} */ diff --git a/core/include/sched.h b/core/include/sched.h index f7384236ff..1b4c6bad7e 100644 --- a/core/include/sched.h +++ b/core/include/sched.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @defgroup core_sched Scheduler * @ingroup core @@ -78,9 +80,6 @@ * @author Hauke Petersen */ -#ifndef SCHED_H -#define SCHED_H - #include #include @@ -385,5 +384,4 @@ static inline int sched_runq_more_than_one(uint8_t prio) } #endif -#endif /* SCHED_H */ /** @} */ diff --git a/core/include/stdio.h b/core/include/stdio.h index cb70c636df..3c335610d7 100644 --- a/core/include/stdio.h +++ b/core/include/stdio.h @@ -6,6 +6,8 @@ * details. */ +#pragma once + /** * @ingroup sys_stdio_null * @@ -22,8 +24,6 @@ * @author Benjamin Valentin */ -#ifndef CORE_STDIO_H -#define CORE_STDIO_H #include_next "stdio.h" #ifdef MODULE_STDIO_NULL @@ -66,5 +66,4 @@ static inline int vprintf_null(const char *__restrict__ format, va_list ap) #endif /* MODULE_STDIO_NULL */ -#endif /* CORE_STDIO_H */ /** @} */ diff --git a/core/include/thread.h b/core/include/thread.h index c226306ef1..1c57cb03f8 100644 --- a/core/include/thread.h +++ b/core/include/thread.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @defgroup core_thread Threading * @ingroup core @@ -116,9 +118,6 @@ * @author Kaspar Schleiser */ -#ifndef THREAD_H -#define THREAD_H - #include "clist.h" #include "cib.h" #include "msg.h" @@ -660,4 +659,3 @@ static inline uintptr_t thread_measure_stack_free(const thread_t *thread) #endif /** @} */ -#endif /* THREAD_H */ diff --git a/core/include/thread_flags.h b/core/include/thread_flags.h index 846fcb64e4..93bc0c5504 100644 --- a/core/include/thread_flags.h +++ b/core/include/thread_flags.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @defgroup core_thread_flags Thread Flags * @ingroup core @@ -54,9 +56,6 @@ * * @author Kaspar Schleiser */ -#ifndef THREAD_FLAGS_H -#define THREAD_FLAGS_H - #include "sched.h" /* for thread_t typedef */ #ifdef __cplusplus @@ -201,5 +200,4 @@ int thread_flags_wake(thread_t *thread); } #endif -#endif /* THREAD_FLAGS_H */ /** @} */ diff --git a/core/lib/include/assert.h b/core/lib/include/assert.h index 322926cae1..8891a95cc2 100644 --- a/core/lib/include/assert.h +++ b/core/lib/include/assert.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @@ -19,9 +21,6 @@ * @author Martine Lenders */ -#ifndef ASSERT_H -#define ASSERT_H - #include #ifdef __cplusplus @@ -169,5 +168,4 @@ __NORETURN void _assert_panic(void); } #endif -#endif /* ASSERT_H */ /** @} */ diff --git a/core/lib/include/bitarithm.h b/core/lib/include/bitarithm.h index ac2a88c402..29aa78a4a1 100644 --- a/core/lib/include/bitarithm.h +++ b/core/lib/include/bitarithm.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @{ @@ -18,9 +20,6 @@ * @author Martine Lenders */ -#ifndef BITARITHM_H -#define BITARITHM_H - #include #include "cpu_conf.h" @@ -278,5 +277,4 @@ static inline unsigned bitarithm_test_and_clear(unsigned state, uint8_t *index) } #endif -#endif /* BITARITHM_H */ /** @} */ diff --git a/core/lib/include/cib.h b/core/lib/include/cib.h index 5743bb6af8..6d9ce40f82 100644 --- a/core/lib/include/cib.h +++ b/core/lib/include/cib.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @{ @@ -30,9 +32,6 @@ * exclusive access as indicated in the API doc. */ -#ifndef CIB_H -#define CIB_H - #include "assert.h" #ifdef __cplusplus @@ -285,5 +284,4 @@ static inline int cib_put_unsafe(cib_t *cib) } #endif -#endif /* CIB_H */ /** @} */ diff --git a/core/lib/include/clist.h b/core/lib/include/clist.h index 27853e0fcd..c646921e57 100644 --- a/core/lib/include/clist.h +++ b/core/lib/include/clist.h @@ -8,6 +8,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @{ @@ -87,9 +89,6 @@ * @author Kaspar Schleiser */ -#ifndef CLIST_H -#define CLIST_H - #include #include #include "list.h" @@ -500,5 +499,4 @@ static inline bool clist_more_than_one(clist_node_t *list) } #endif -#endif /* CLIST_H */ /** @} */ diff --git a/core/lib/include/compiler_hints.h b/core/lib/include/compiler_hints.h index 7d3bc8583f..f056671119 100644 --- a/core/lib/include/compiler_hints.h +++ b/core/lib/include/compiler_hints.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_internal * @{ @@ -18,9 +20,6 @@ * @author Michel Rottleuthner */ -#ifndef COMPILER_HINTS_H -#define COMPILER_HINTS_H - #include #include @@ -198,5 +197,4 @@ static inline unsigned may_be_zero(unsigned n) } #endif -#endif /* COMPILER_HINTS_H */ /** @} */ diff --git a/core/lib/include/container.h b/core/lib/include/container.h index 98ffe557ce..1473760d27 100644 --- a/core/lib/include/container.h +++ b/core/lib/include/container.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_internal * @{ @@ -18,9 +20,6 @@ * @author Michel Rottleuthner */ -#ifndef CONTAINER_H -#define CONTAINER_H - #include #include @@ -87,5 +86,4 @@ extern "C" { } #endif -#endif /* CONTAINER_H */ /** @} */ diff --git a/core/lib/include/debug.h b/core/lib/include/debug.h index e1337ba795..620de78267 100644 --- a/core/lib/include/debug.h +++ b/core/lib/include/debug.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @{ @@ -21,9 +23,6 @@ * @author Kaspar Schleiser */ -#ifndef DEBUG_H -#define DEBUG_H - #include #include "sched.h" #include "thread.h" @@ -148,5 +147,4 @@ extern "C" { } #endif -#endif /* DEBUG_H */ /** @} */ diff --git a/core/lib/include/irq.h b/core/lib/include/irq.h index 64c6c09787..37990dab3c 100644 --- a/core/lib/include/irq.h +++ b/core/lib/include/irq.h @@ -6,6 +6,9 @@ * directory for more details. */ +#ifndef IRQ_H +#define IRQ_H + /** * @defgroup core_irq IRQ Handling * @ingroup core @@ -19,9 +22,6 @@ * @author Hauke Petersen */ -#ifndef IRQ_H -#define IRQ_H - #include #include "cpu_conf.h" @@ -30,9 +30,9 @@ extern "C" { #endif #ifdef IRQ_API_INLINED -#define MAYBE_INLINE static inline __attribute__((always_inline)) +# define MAYBE_INLINE static inline __attribute__((always_inline)) #else -#define MAYBE_INLINE +# define MAYBE_INLINE #endif /* IRQ_API_INLINED */ #ifndef IRQ_API_INLINED @@ -91,12 +91,12 @@ MAYBE_INLINE bool irq_is_enabled(void); MAYBE_INLINE bool irq_is_in(void); #else -#include "irq_arch.h" /* IWYU pragma: export */ -#endif /* IRQ_API_INLINED */ +# include "irq_arch.h" /* IWYU pragma: export */ +#endif /* IRQ_API_INLINED */ #ifdef __cplusplus } #endif -#endif /* IRQ_H */ /** @} */ +#endif /* IRQ_H */ diff --git a/core/lib/include/kernel_defines.h b/core/lib/include/kernel_defines.h index 9698477fb1..92034baad3 100644 --- a/core/lib/include/kernel_defines.h +++ b/core/lib/include/kernel_defines.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_internal * @{ @@ -18,9 +20,6 @@ * @author Michel Rottleuthner */ -#ifndef KERNEL_DEFINES_H -#define KERNEL_DEFINES_H - #include "modules.h" #include "riot_version.h" #include "compiler_hints.h" @@ -34,5 +33,4 @@ extern "C" { } #endif -#endif /* KERNEL_DEFINES_H */ /** @} */ diff --git a/core/lib/include/kernel_init.h b/core/lib/include/kernel_init.h index 2e724d5ae0..018141e2e3 100644 --- a/core/lib/include/kernel_init.h +++ b/core/lib/include/kernel_init.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_internal * @{ @@ -18,9 +20,6 @@ * @author Kaspar Schleiser */ -#ifndef KERNEL_INIT_H -#define KERNEL_INIT_H - #ifdef __cplusplus extern "C" { #endif @@ -69,5 +68,4 @@ static inline void early_init(void) {} } #endif -#endif /* KERNEL_INIT_H */ /** @} */ diff --git a/core/lib/include/list.h b/core/lib/include/list.h index 1eb477118b..2bed483b0c 100644 --- a/core/lib/include/list.h +++ b/core/lib/include/list.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @{ @@ -20,9 +22,6 @@ * @author Víctor Ariño */ -#ifndef LIST_H -#define LIST_H - #ifdef __cplusplus extern "C" { #endif @@ -99,5 +98,4 @@ static inline list_node_t *list_remove(list_node_t *list, list_node_t *node) } #endif -#endif /* LIST_H */ /** @} */ diff --git a/core/lib/include/log.h b/core/lib/include/log.h index 026b3c405b..1fb65f4bae 100644 --- a/core/lib/include/log.h +++ b/core/lib/include/log.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @{ @@ -30,9 +32,6 @@ * @author Kaspar Schleiser */ -#ifndef LOG_H -#define LOG_H - #ifdef __cplusplus extern "C" { #endif @@ -124,5 +123,4 @@ enum { } #endif -#endif /* LOG_H */ /** @} */ diff --git a/core/lib/include/macros/math.h b/core/lib/include/macros/math.h index cf7c374445..1eea61c9f9 100644 --- a/core/lib/include/macros/math.h +++ b/core/lib/include/macros/math.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_macros * @{ @@ -16,9 +18,6 @@ * @author Benjamin Valentin */ -#ifndef MACROS_MATH_H -#define MACROS_MATH_H - #ifdef __cplusplus extern "C" { #endif @@ -57,5 +56,4 @@ extern "C" { } #endif -#endif /* MACROS_MATH_H */ /** @} */ diff --git a/core/lib/include/macros/units.h b/core/lib/include/macros/units.h index ff3a6ca98d..ec7c4f999e 100644 --- a/core/lib/include/macros/units.h +++ b/core/lib/include/macros/units.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_macros * @{ @@ -16,9 +18,6 @@ * @author Benjamin Valentin */ -#ifndef MACROS_UNITS_H -#define MACROS_UNITS_H - #ifdef __cplusplus extern "C" { #endif @@ -57,5 +56,4 @@ extern "C" { } #endif -#endif /* MACROS_UNITS_H */ /** @} */ diff --git a/core/lib/include/macros/utils.h b/core/lib/include/macros/utils.h index d3ec5027ac..30ee3bd425 100644 --- a/core/lib/include/macros/utils.h +++ b/core/lib/include/macros/utils.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_macros * @{ @@ -16,9 +18,6 @@ * @author Marian Buschsieweke */ -#ifndef MACROS_UTILS_H -#define MACROS_UTILS_H - #ifdef __cplusplus extern "C" { #endif @@ -93,5 +92,4 @@ extern "C" { } #endif -#endif /* MACROS_UTILS_H */ /** @} */ diff --git a/core/lib/include/macros/xtstr.h b/core/lib/include/macros/xtstr.h index 8e36da15c7..850ebecada 100644 --- a/core/lib/include/macros/xtstr.h +++ b/core/lib/include/macros/xtstr.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_macros * @{ @@ -16,9 +18,6 @@ * @author Gunar Schorcht */ -#ifndef MACROS_XTSTR_H -#define MACROS_XTSTR_H - #include #ifdef __cplusplus @@ -41,5 +40,4 @@ extern "C" { } #endif -#endif /* MACROS_XTSTR_H */ /** @} */ diff --git a/core/lib/include/modules.h b/core/lib/include/modules.h index 8310cf36d6..7a555b65c4 100644 --- a/core/lib/include/modules.h +++ b/core/lib/include/modules.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_internal * @{ @@ -18,9 +20,6 @@ * @author Michel Rottleuthner */ -#ifndef MODULES_H -#define MODULES_H - #ifdef __cplusplus extern "C" { #endif @@ -107,5 +106,4 @@ extern "C" { } #endif -#endif /* MODULES_H */ /** @} */ diff --git a/core/lib/include/panic.h b/core/lib/include/panic.h index 7c86861ef0..07b67d5a46 100644 --- a/core/lib/include/panic.h +++ b/core/lib/include/panic.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @{ @@ -19,9 +21,6 @@ * @author Kévin Roussel */ -#ifndef PANIC_H -#define PANIC_H - #include "kernel_defines.h" #ifdef __cplusplus @@ -100,5 +99,4 @@ void panic_arch(void); } #endif -#endif /* PANIC_H */ /** @} */ diff --git a/core/lib/include/priority_queue.h b/core/lib/include/priority_queue.h index b23527fca6..1ca2660848 100644 --- a/core/lib/include/priority_queue.h +++ b/core/lib/include/priority_queue.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @{ @@ -16,9 +18,6 @@ * @author Kaspar Schleiser */ -#ifndef PRIORITY_QUEUE_H -#define PRIORITY_QUEUE_H - #include #include @@ -139,4 +138,3 @@ void priority_queue_print_node(priority_queue_t *root); #endif /** @} */ -#endif /* PRIORITY_QUEUE_H */ diff --git a/core/lib/include/ringbuffer.h b/core/lib/include/ringbuffer.h index 3601f8291e..88bbee43b3 100644 --- a/core/lib/include/ringbuffer.h +++ b/core/lib/include/ringbuffer.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @{ @@ -22,9 +24,6 @@ * @} */ -#ifndef RINGBUFFER_H -#define RINGBUFFER_H - #ifdef __cplusplus extern "C" { #endif @@ -163,5 +162,3 @@ unsigned ringbuffer_peek(const ringbuffer_t *__restrict rb, char *buf, #ifdef __cplusplus } #endif - -#endif /* RINGBUFFER_H */ diff --git a/core/lib/include/riot_version.h b/core/lib/include/riot_version.h index 688b1c9d27..e69346fb03 100644 --- a/core/lib/include/riot_version.h +++ b/core/lib/include/riot_version.h @@ -7,6 +7,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_internal * @{ @@ -18,9 +20,6 @@ * @author Michel Rottleuthner */ -#ifndef RIOT_VERSION_H -#define RIOT_VERSION_H - #include #ifdef __cplusplus @@ -60,5 +59,4 @@ extern "C" { } #endif -#endif /* RIOT_VERSION_H */ /** @} */ diff --git a/core/lib/include/rmutex.h b/core/lib/include/rmutex.h index 7a3daa7146..c80927d2cd 100644 --- a/core/lib/include/rmutex.h +++ b/core/lib/include/rmutex.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @defgroup core_sync_rmutex Recursive Mutex * @ingroup core_sync @@ -20,9 +22,6 @@ * */ -#ifndef RMUTEX_H -#define RMUTEX_H - #include #include "mutex.h" @@ -109,5 +108,4 @@ void rmutex_unlock(rmutex_t *rmutex); } #endif -#endif /* RMUTEX_H */ /** @} */ diff --git a/core/lib/include/thread_config.h b/core/lib/include/thread_config.h index d3f3542d95..c9f7a99858 100644 --- a/core/lib/include/thread_config.h +++ b/core/lib/include/thread_config.h @@ -8,6 +8,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_thread * @@ -19,9 +21,6 @@ * @author Kaspar Schleiser */ -#ifndef THREAD_CONFIG_H -#define THREAD_CONFIG_H - #include "cpu_conf.h" #include "sched.h" /* for SCHED_PRIO_LEVELS */ @@ -140,5 +139,4 @@ extern "C" { } #endif -#endif /* THREAD_CONFIG_H */ /** @} */ diff --git a/core/lib/include/xfa.h b/core/lib/include/xfa.h index e18196ff78..726674dbe9 100644 --- a/core/lib/include/xfa.h +++ b/core/lib/include/xfa.h @@ -6,6 +6,8 @@ * directory for more details. */ +#pragma once + /** * @ingroup core_util * @brief Cross File Arrays @@ -22,9 +24,6 @@ * @author Kaspar Schleiser */ -#ifndef XFA_H -#define XFA_H - #include #include "compiler_hints.h" @@ -194,5 +193,4 @@ extern "C" { } #endif -#endif /* XFA_H */ /** @} */