diff --git a/routes/css.cpp b/routes/css.cpp index 6695bd2..57d1ec9 100644 --- a/routes/css.cpp +++ b/routes/css.cpp @@ -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"); } }