Fix compile on darwin

Summary: We need to start doing some CI on Macs.

Test Plan: works now

Reviewers: yhchiang

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D39489
This commit is contained in:
Igor Canadi 2015-06-03 16:52:51 -04:00
parent 3af668ed17
commit 2d0b9e5f0a

View file

@ -7,6 +7,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#include <algorithm>
#include <iostream>
#include <mutex>
@ -75,7 +80,7 @@ std::string Key(uint64_t key, int length) {
if (length > kBufSize) {
length = kBufSize;
}
snprintf(buf, kBufSize, "%0*lu", length, key);
snprintf(buf, kBufSize, "%0*" PRIu64, length, key);
return std::string(buf);
}