Skip to content

Commit

Permalink
Enable a building on the iOS platform (rust-rocksdb#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire authored and vldm committed Sep 8, 2022
1 parent 61277d2 commit 52a7198
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 12 additions & 1 deletion librocksdb-sys/build.rs
Expand Up @@ -147,7 +147,18 @@ fn build_rocksdb() {
lib_sources.push("util/crc32c_arm64.cc")
}

if target.contains("darwin") {
if target.contains("apple-ios") {
config.define("OS_MACOSX", None);

config.define("IOS_CROSS_COMPILE", None);
config.define("PLATFORM", "IOS");
config.define("NIOSTATS_CONTEXT", None);
config.define("NPERF_CONTEXT", None);
config.define("ROCKSDB_PLATFORM_POSIX", None);
config.define("ROCKSDB_LIB_IO_POSIX", None);

env::set_var("IPHONEOS_DEPLOYMENT_TARGET", "11.0");
} else if target.contains("darwin") {
config.define("OS_MACOSX", None);
config.define("ROCKSDB_PLATFORM_POSIX", None);
config.define("ROCKSDB_LIB_IO_POSIX", None);
Expand Down
8 changes: 4 additions & 4 deletions src/db.rs
Expand Up @@ -992,28 +992,28 @@ impl<T: ThreadMode> DBWithThreadMode<T> {
}

/// Return the values associated with the given keys and column families.
pub fn multi_get_cf<'a, 'b: 'a, K, I, W: 'b>(
pub fn multi_get_cf<'a, 'b: 'a, K, I, W>(
&'a self,
keys: I,
) -> Vec<Result<Option<Vec<u8>>, Error>>
where
K: AsRef<[u8]>,
I: IntoIterator<Item = (&'b W, K)>,
W: AsColumnFamilyRef,
W: 'b + AsColumnFamilyRef,
{
self.multi_get_cf_opt(keys, &ReadOptions::default())
}

/// Return the values associated with the given keys and column families using read options.
pub fn multi_get_cf_opt<'a, 'b: 'a, K, I, W: 'b>(
pub fn multi_get_cf_opt<'a, 'b: 'a, K, I, W>(
&'a self,
keys: I,
readopts: &ReadOptions,
) -> Vec<Result<Option<Vec<u8>>, Error>>
where
K: AsRef<[u8]>,
I: IntoIterator<Item = (&'b W, K)>,
W: AsColumnFamilyRef,
W: 'b + AsColumnFamilyRef,
{
let (cfs_and_keys, keys_sizes): (Vec<(_, Box<[u8]>)>, Vec<_>) = keys
.into_iter()
Expand Down

0 comments on commit 52a7198

Please sign in to comment.