From 445f1235bf0ff4001d63e5bd9bd2491f6ab3ea1d Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Tue, 16 May 2017 11:50:43 -0700 Subject: [PATCH] s/std::snprintf/snprintf Summary: Looks like std::snprintf is not available on all platforms (e.g. MSVC 2010). Change it back to snprintf, where we have a macro in port.h to workaround compatibility. Closes https://github.com/facebook/rocksdb/pull/2308 Differential Revision: D5070988 Pulled By: yiwu-arbug fbshipit-source-id: bedfc1660bab0431c583ad434b7e68265e1211b1 --- utilities/blob_db/blob_file.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/utilities/blob_db/blob_file.cc b/utilities/blob_db/blob_file.cc index a1a0a16e86..411de255d2 100644 --- a/utilities/blob_db/blob_file.cc +++ b/utilities/blob_db/blob_file.cc @@ -4,9 +4,9 @@ // of patent rights can be found in the PATENTS file in the same directory. #ifndef ROCKSDB_LITE +#include #include #include -#include #include #include "utilities/blob_db/blob_db_impl.h" @@ -89,17 +89,17 @@ std::shared_ptr BlobFile::OpenSequentialReader( std::string BlobFile::DumpState() const { char str[1000]; - std::snprintf(str, sizeof(str), - "path: %s fn: %" PRIu64 " blob_count: %" PRIu64 - " gc_epoch: %" PRIu64 " file_size: %" PRIu64 - " deleted_count: %" PRIu64 " deleted_size: %" PRIu64 - " closed: %d can_be_deleted: %d ttl_range: (%d, %d)" - " sn_range: (%" PRIu64 " %" PRIu64 "), writer: %d reader: %d", - path_to_dir_.c_str(), file_number_, blob_count_.load(), - gc_epoch_.load(), file_size_.load(), deleted_count_, - deleted_size_, closed_.load(), can_be_deleted_.load(), - ttl_range_.first, ttl_range_.second, sn_range_.first, - sn_range_.second, (!!log_writer_), (!!ra_file_reader_)); + snprintf(str, sizeof(str), + "path: %s fn: %" PRIu64 " blob_count: %" PRIu64 " gc_epoch: %" PRIu64 + " file_size: %" PRIu64 " deleted_count: %" PRIu64 + " deleted_size: %" PRIu64 + " closed: %d can_be_deleted: %d ttl_range: (%d, %d)" + " sn_range: (%" PRIu64 " %" PRIu64 "), writer: %d reader: %d", + path_to_dir_.c_str(), file_number_, blob_count_.load(), + gc_epoch_.load(), file_size_.load(), deleted_count_, deleted_size_, + closed_.load(), can_be_deleted_.load(), ttl_range_.first, + ttl_range_.second, sn_range_.first, sn_range_.second, + (!!log_writer_), (!!ra_file_reader_)); return str; }