[Fix java build] Stop using non standard std::make_unique

Summary: std::make_unique is not standard and not always available, remove it

Test Plan: Run "make clean jclean rocksdbjava jtest -j8" on my mac

Reviewers: yhchiang, yiwu, sdong, andrewkr

Reviewed By: andrewkr

Subscribers: andrewkr, dhruba

Differential Revision: https://reviews.facebook.net/D61143
main
Islam AbdelRahman 8 years ago
parent e12270dfee
commit 8745f013ff
  1. 3
      java/rocksjni/options.cc
  2. 3
      java/rocksjni/rocksjni.cc
  3. 3
      java/rocksjni/ttl.cc

@ -1104,7 +1104,8 @@ std::vector<rocksdb::CompressionType> rocksdb_compression_vector_helper(
*/
jbyteArray rocksdb_compression_list_helper(JNIEnv* env,
std::vector<rocksdb::CompressionType> compressionLevels) {
std::unique_ptr<jbyte[]> jbuf = std::make_unique<jbyte[]>(compressionLevels.size());
std::unique_ptr<jbyte[]> jbuf =
std::unique_ptr<jbyte[]>(new jbyte[compressionLevels.size()]);
for (std::vector<rocksdb::CompressionType>::size_type i = 0;
i != compressionLevels.size(); i++) {
jbuf[i] = compressionLevels[i];

@ -115,7 +115,8 @@ jlongArray rocksdb_open_helper(JNIEnv* env, jlong jopt_handle,
// check if open operation was successful
if (s.ok()) {
jsize resultsLen = 1 + len_cols; //db handle + column family handles
std::unique_ptr<jlong[]> results = std::make_unique<jlong[]>(resultsLen);
std::unique_ptr<jlong[]> results =
std::unique_ptr<jlong[]>(new jlong[resultsLen]);
results[0] = reinterpret_cast<jlong>(db);
for(int i = 1; i <= len_cols; i++) {
results[i] = reinterpret_cast<jlong>(handles[i - 1]);

@ -96,7 +96,8 @@ jlongArray
// check if open operation was successful
if (s.ok()) {
jsize resultsLen = 1 + len_cols; //db handle + column family handles
std::unique_ptr<jlong[]> results = std::make_unique<jlong[]>(resultsLen);
std::unique_ptr<jlong[]> results =
std::unique_ptr<jlong[]>(new jlong[resultsLen]);
results[0] = reinterpret_cast<jlong>(db);
for(int i = 1; i <= len_cols; i++) {
results[i] = reinterpret_cast<jlong>(handles[i - 1]);

Loading…
Cancel
Save