diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-06-21 22:24:30 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-06-21 22:47:06 +0200 |
commit | 52d9a4726da51b78bc5ed445588efb17f5f4e637 (patch) | |
tree | 9697f1f4d3d8bd7b6bf72616e94cce0bd4328f6e | |
parent | b671601498b8694477fce8519b0d54d165a6a18d (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
-rw-r--r-- | src/html.cc | 3 |
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] |