Skip to content

Commit 0fee896

Browse files
author
krad
committed
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
1 parent 10d46b9 commit 0fee896

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

utilities/persistent_cache/hash_table_bench.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// of patent rights can be found in the PATENTS file in the same directory.
55
//
66

7-
#ifndef ROCKSDB_LITE
7+
#if !defined(OS_WIN) && !defined(ROCKSDB_LITE)
88

99
#ifndef GFLAGS
1010
#include <cstdio>
@@ -18,8 +18,8 @@ int main() { fprintf(stderr, "Please install gflags to run tools\n"); }
1818
#include <string>
1919
#include <unordered_map>
2020

21-
#include "include/rocksdb/env.h"
2221
#include "port/port_posix.h"
22+
#include "rocksdb/env.h"
2323
#include "util/mutexlock.h"
2424
#include "utilities/persistent_cache/hash_table.h"
2525

utilities/persistent_cache/persistent_cache_tier.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ struct PersistentCacheOptions {
192192
// file size in order to avoid dead lock.
193193
size_t write_buffer_count() const {
194194
assert(write_buffer_size);
195-
return (writer_qdepth + 1.2) * cache_file_size / write_buffer_size;
195+
return static_cast<size_t>((writer_qdepth + 1.2) * cache_file_size /
196+
write_buffer_size);
196197
}
197198

198199
// writer-dispatch-size

0 commit comments

Comments
 (0)