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 ab673c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ uint64_t micros() {
}

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

Expand Down

0 comments on commit ab673c0

Please sign in to comment.