Commit a052a585 authored by Juho Snellman's avatar Juho Snellman

Fix build on clang

- std::ceil() could be used in constant expression on gcc, but not in
  clang
parent 1ad6ef21
...@@ -86,7 +86,6 @@ ...@@ -86,7 +86,6 @@
#define RATAS_TIMER_WHEEL_H #define RATAS_TIMER_WHEEL_H
#include <cassert> #include <cassert>
#include <cmath>
#include <cstdlib> #include <cstdlib>
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>
...@@ -282,7 +281,7 @@ private: ...@@ -282,7 +281,7 @@ private:
bool process_current_slot(Tick now, size_t max_execute, int level); bool process_current_slot(Tick now, size_t max_execute, int level);
static const int WIDTH_BITS = 8; static const int WIDTH_BITS = 8;
static const int NUM_LEVELS = std::ceil(64 / WIDTH_BITS); static const int NUM_LEVELS = (64 + WIDTH_BITS - 1) / WIDTH_BITS;
static const int MAX_LEVEL = NUM_LEVELS - 1; static const int MAX_LEVEL = NUM_LEVELS - 1;
static const int NUM_SLOTS = 1 << WIDTH_BITS; static const int NUM_SLOTS = 1 << WIDTH_BITS;
// A bitmask for looking at just the bits in the timestamp relevant to // A bitmask for looking at just the bits in the timestamp relevant to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment