Fixed broken build due to format specifier

Summary:
Clang expects %llu for uint64_t, while gcc expects %lu. Replaced the format
specifier with a format macro. This should fix the build on gcc and Clang.

Test Plan: Build on gcc and clang.

Reviewers: rven, anthony, yhchiang, sdong, igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D46431
This commit is contained in:
Andres Notzli 2015-09-08 15:46:16 -07:00
parent 6bdc484fd8
commit 0ccf2db385

View File

@ -6,6 +6,12 @@
#ifndef ROCKSDB_LITE
#include "util/ldb_cmd.h"
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#include "db/dbformat.h"
#include "db/db_impl.h"
#include "db/log_reader.h"
@ -609,7 +615,7 @@ void ManifestDumpCommand::DoCommand() {
while ((entry = readdir(d.get())) != nullptr) {
unsigned int match;
uint64_t num;
if (sscanf(entry->d_name, "MANIFEST-%lu%n", &num, &match) &&
if (sscanf(entry->d_name, "MANIFEST-%" PRIu64 "%n", &num, &match) &&
match == strlen(entry->d_name)) {
if (!found) {
manifestfile = db_path_ + "/" + std::string(entry->d_name);