Fix build on GCC

This commit is contained in:
blankie 2023-05-12 17:23:26 +07:00
parent e83a44d7b5
commit 4d0230cc25
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
#include "routes.h"
#include "../servehelper.h"
#define CSS R"EOF(
static const constexpr char css[] = R"EOF(
/* GENERAL */
:root {
--background-color: black;
@ -131,10 +131,10 @@
border-style: solid;
border-color: var(--error-border-color);
}
)EOF"
#define CSS_LEN sizeof(CSS) / sizeof(CSS[0]) - 1
)EOF";
#define CSS_LEN sizeof(css) / sizeof(css[0]) - 1
const uint64_t css_hash = FastHashConstEval(CSS, CSS_LEN, 0);
const uint64_t css_hash = FastHashConstEval(css, CSS_LEN, 0);
void css_route(const httplib::Request& req, httplib::Response& res) {
res.set_header("ETag", std::string(1, '"') + std::to_string(css_hash) + '"');
@ -145,6 +145,6 @@ void css_route(const httplib::Request& req, httplib::Response& res) {
res.set_header("Content-Length", std::to_string(CSS_LEN));
res.set_header("Content-Type", "text/css");
} else {
res.set_content(CSS, CSS_LEN, "text/css");
res.set_content(css, CSS_LEN, "text/css");
}
}