From 4d0230cc25635e9c2c0f201427d67ad6b1873170 Mon Sep 17 00:00:00 2001 From: blankie Date: Fri, 12 May 2023 17:23:26 +0700 Subject: [PATCH] Fix build on GCC --- routes/css.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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"); } }