diff --git a/routes/css.cpp b/routes/css.cpp index bb69822..50aebe4 100644 --- a/routes/css.cpp +++ b/routes/css.cpp @@ -134,7 +134,13 @@ static const constexpr char css[] = R"EOF( )EOF"; #define CSS_LEN sizeof(css) / sizeof(css[0]) - 1 -constinit const uint64_t css_hash = FastHash(css, CSS_LEN, 0); +#if __cpp_constinit + #define CONSTINIT constinit +#else + #define CONSTINIT +#endif + +CONSTINIT const uint64_t css_hash = FastHash(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) + '"');