Add compiler_support.h
(#25274)
This commit is contained in:
parent
fa24b0fcce
commit
955809bd5a
36 changed files with 142 additions and 81 deletions
15
quantum/compiler_support.h
Normal file
15
quantum/compiler_support.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2025 QMK Contributors
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
/**
|
||||
* @brief Perfom an assertion at compile time.
|
||||
*
|
||||
* `_Static_assert` is C<23, while `static_assert` is C++/C23.
|
||||
*/
|
||||
#if !defined(STATIC_ASSERT)
|
||||
# ifdef __cplusplus
|
||||
# define STATIC_ASSERT static_assert
|
||||
# else
|
||||
# define STATIC_ASSERT _Static_assert
|
||||
# endif
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue