Skip to content

Commit ab673c0

Browse files
committed
Fix g++6 compile error
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); ```
1 parent 93bd824 commit ab673c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/db/db_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2234,7 +2234,7 @@ uint64_t micros() {
22342234
}
22352235

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

0 commit comments

Comments
 (0)