[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
This commit is contained in:
Islam AbdelRahman 2016-07-26 13:18:31 -07:00
parent e12270dfee
commit 8745f013ff
3 changed files with 6 additions and 3 deletions

View File

@ -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];

View File

@ -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]);

View File

@ -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]);