summaryrefslogtreecommitdiffstats
path: root/src/diag.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/diag.h')
-rw-r--r--src/diag.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/diag.h b/src/diag.h
index 987d4b4..a086942 100644
--- a/src/diag.h
+++ b/src/diag.h
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: 0BSD
/**
- * Formatters for diagnostic messages.
+ * Diagnostic messages.
*/
#ifndef BFS_DIAG_H
@@ -12,6 +12,16 @@
#include "config.h"
#include <stdarg.h>
+/**
+ * static_assert() with an optional second argument.
+ */
+#if __STDC_VERSION__ >= 202311L
+# define bfs_static_assert static_assert
+#else
+# define bfs_static_assert(...) BFS_STATIC_ASSERT(__VA_ARGS__, #__VA_ARGS__, )
+# define BFS_STATIC_ASSERT(expr, msg, ...) _Static_assert(expr, msg)
+#endif
+
struct bfs_expr;
/**