fixed build issues

This commit is contained in:
EntireTwix 2021-06-03 18:39:18 -07:00
parent 0dae1c3a74
commit 2e05197791
2 changed files with 52 additions and 45 deletions

View file

@ -1,5 +1,5 @@
#pragma once
// `max_log_size` must be divisible by `pre_log_size`
constexpr auto max_log_size = 100; // Setting to 0 does not compile logging
constexpr auto pre_log_size = 10;
constexpr unsigned max_log_size = 100; // Setting to 0 does not compile logging
constexpr unsigned pre_log_size = 10;

View file

@ -23,7 +23,13 @@ void SaveSig(int s)
int main(int argc, char **argv)
{
static_assert(pre_log_size <= max_log_size, "`max_log_size` must be larger than `pre_log_size`.");
static_assert(!(max_log_size % pre_log_size) + (!max_log_size), "`max_log_size` must be a multiple of `pre_log_size`.");
if constexpr (!(max_log_size % pre_log_size) && max_log_size)
{
std::cerr << "`max_log_size` must be a multiple of `pre_log_size`.\n";
return 0;
}
else
{
if (argc != 4)
{
@ -71,6 +77,7 @@ int main(int argc, char **argv)
resp->addHeader("Access-Control-Allow-Origin", "*");
});
app().loadConfigFile("../config.json").registerController(API).setThreadNum(std::stoul(argv[3])).run();
}
return 0;
}