Fix Windows build

Summary:
Fix 2 issues that was breaking Windows build
1) double to size_t potential downcast warning
2) port_posix is not ready for windows, avoiding building hash_table_bench to
avoid build break

Test Plan: compile in Windoes and make check

Reviewers: sdong, andrewkr

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D59265
main
krad 8 years ago
parent 10d46b9c8f
commit 0fee896841
  1. 4
      utilities/persistent_cache/hash_table_bench.cc
  2. 3
      utilities/persistent_cache/persistent_cache_tier.h

@ -4,7 +4,7 @@
// of patent rights can be found in the PATENTS file in the same directory.
//
#ifndef ROCKSDB_LITE
#if !defined(OS_WIN) && !defined(ROCKSDB_LITE)
#ifndef GFLAGS
#include <cstdio>
@ -18,8 +18,8 @@ int main() { fprintf(stderr, "Please install gflags to run tools\n"); }
#include <string>
#include <unordered_map>
#include "include/rocksdb/env.h"
#include "port/port_posix.h"
#include "rocksdb/env.h"
#include "util/mutexlock.h"
#include "utilities/persistent_cache/hash_table.h"

@ -192,7 +192,8 @@ struct PersistentCacheOptions {
// file size in order to avoid dead lock.
size_t write_buffer_count() const {
assert(write_buffer_size);
return (writer_qdepth + 1.2) * cache_file_size / write_buffer_size;
return static_cast<size_t>((writer_qdepth + 1.2) * cache_file_size /
write_buffer_size);
}
// writer-dispatch-size

Loading…
Cancel
Save