aboutsummaryrefslogtreecommitdiff
path: root/src/html.cc
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-06-21 22:24:30 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-06-21 22:47:06 +0200
commit52d9a4726da51b78bc5ed445588efb17f5f4e637 (patch)
tree9697f1f4d3d8bd7b6bf72616e94cce0bd4328f6e /src/html.cc
parentb671601498b8694477fce8519b0d54d165a6a18d (diff)
Only enable static_assert if supported
Standards below C++11 don't support it, so we simply disable the static assert. It is only required to be enabled in the CI in one build. Reported-by: dogma
Diffstat (limited to 'src/html.cc')
-rw-r--r--src/html.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/html.cc b/src/html.cc
index 5e1f6ba7..944977b2 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -3568,8 +3568,11 @@ static const TagInfo Tags[] = {
};
#define NTAGS (sizeof(Tags)/sizeof(Tags[0]))
+/* Only available in C++11 and up */
+#if __cpp_static_assert
static_assert(NTAGS == HTML_NTAGS,
"Mismatch between number of tags in Tags and HTML_NTAGS");
+#endif
/*
* Compares tag from buffer ('/' or '>' or space-ended string) [p1]