Skip to content

Commit

Permalink
Fix g++6 compile error
Browse files Browse the repository at this point in the history
this error would be emitted when compiling with g++6
```
/pebblesdb/src/db/db_test.cc: In function ‘void
leveldb::print_timer_info(std::__cxx11::string, uint64_t, uint64_t)’:
/pebblesdb/src/db/db_test.cc:2237:25: error: call of overloaded
‘abs(uint64_t)’ is ambiguous
  uint64_t diff = abs(a-b);
```
  • Loading branch information
cryptokat committed Jan 18, 2019
1 parent 93bd824 commit cebee6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2234,8 +2234,8 @@ uint64_t micros() {
}

void print_timer_info(std::string msg, uint64_t a, uint64_t b) {
uint64_t diff = abs(a-b);
printf("%s: %lu micros (%f ms)\n", msg.c_str(), diff, diff/1000.0);
uint64_t diff = a > b ? a - b : b - a;
printf("%s: %llu micros (%f ms)\n", msg.c_str(), diff, diff/1000.0);
}

void print_divider() {
Expand Down

0 comments on commit cebee6e

Please sign in to comment.