mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-16 16:12:14 +11:00
🐛 when pre_log_size == 0, illegal instruction would be generated
This commit is contained in:
parent
11647eb827
commit
3a2f04ab3b
1 changed files with 9 additions and 3 deletions
12
main.cpp
12
main.cpp
|
|
@ -22,9 +22,15 @@ void SaveSig(int s)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
// Static assertations for logging only (!max_log_size)
|
||||
static_assert(!max_log_size || pre_log_size < max_log_size, "`max_log_size` must be larger than `pre_log_size`.");
|
||||
static_assert(!max_log_size || !(max_log_size % pre_log_size), "`max_log_size` must be a multiple of `pre_log_size`.");
|
||||
static_assert(pre_log_size <= max_log_size, "`max_log_size` must be larger than `pre_log_size`.");
|
||||
if constexpr (max_log_size && pre_log_size)
|
||||
{
|
||||
if (max_log_size % pre_log_size)
|
||||
{
|
||||
std::cerr << "`max_log_size` must be a multiple of `pre_log_size`.";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (argc != 4)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue