aboutsummaryrefslogtreecommitdiff
path: root/quantum/compiler_support.h
diff options
context:
space:
mode:
authorPablo Martínez <[email protected]>2025-05-22 15:31:15 +0200
committerGitHub <[email protected]>2025-05-22 23:31:15 +1000
commit955809bd5aee8b1444595b450eeeef1f42799995 (patch)
tree08da1f696605925286f681a2b738fa5f35cd0386 /quantum/compiler_support.h
parentfa24b0fcce2c5f3330f2d798c3caf91a130babdb (diff)
downloadqmk_firmware-955809bd5aee8b1444595b450eeeef1f42799995.tar.gz
qmk_firmware-955809bd5aee8b1444595b450eeeef1f42799995.zip
Add `compiler_support.h` (#25274)
Diffstat (limited to 'quantum/compiler_support.h')
-rw-r--r--quantum/compiler_support.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/quantum/compiler_support.h b/quantum/compiler_support.h
new file mode 100644
index 0000000000..5c0c4d2835
--- /dev/null
+++ b/quantum/compiler_support.h
@@ -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