fpga_clock: Don't use constexpr for time_points.

These are not constexpr on some compilers.
This commit is contained in:
Peter Johnson
2017-08-19 22:56:58 -07:00
parent 8b460f5944
commit d3b636d073
2 changed files with 6 additions and 5 deletions

View File

@@ -22,11 +22,10 @@ class fpga_clock {
static fpga_clock::time_point now() noexcept;
static constexpr bool is_steady = true;
static constexpr fpga_clock::time_point epoch() { return time_point(zero()); }
static fpga_clock::time_point epoch() noexcept { return time_point(zero()); }
static constexpr fpga_clock::duration zero() { return duration(0); }
static fpga_clock::duration zero() noexcept { return duration(0); }
static constexpr time_point min_time{
time_point(duration(std::numeric_limits<duration::rep>::min()))};
static const time_point min_time;
};
} // namespace hal

View File

@@ -11,7 +11,9 @@
#include "llvm/raw_ostream.h"
namespace hal {
constexpr fpga_clock::time_point fpga_clock::min_time;
const fpga_clock::time_point fpga_clock::min_time =
fpga_clock::time_point(fpga_clock::duration(
std::numeric_limits<fpga_clock::duration::rep>::min()));
fpga_clock::time_point fpga_clock::now() noexcept {
int32_t status = 0;