summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2014-12-03 22:27:40 +1100
committerLeith Bade <leith@mapbox.com>2014-12-03 22:27:40 +1100
commit9db5d2ac55de5cb96c41f0b0c1e88a9bc331449f (patch)
tree685cb0f0ec5d9e7b3a16171d74736d39cc7190da
parent31077a813cad7d01c9f086bdd6cbfaae7250df85 (diff)
downloadqtlocation-mapboxgl-9db5d2ac55de5cb96c41f0b0c1e88a9bc331449f.tar.gz
Remove boost::make_unique
-rw-r--r--android/cpp/native_map_view.cpp5
-rw-r--r--platform/android/asset_request_baton_libzip.cpp7
-rw-r--r--platform/default/http_request_baton_curl.cpp3
3 files changed, 6 insertions, 9 deletions
diff --git a/android/cpp/native_map_view.cpp b/android/cpp/native_map_view.cpp
index 1fef8551e7..58e11b425c 100644
--- a/android/cpp/native_map_view.cpp
+++ b/android/cpp/native_map_view.cpp
@@ -4,8 +4,6 @@
#include <list>
#include <tuple>
-#include <boost/make_unique.hpp>
-
#include <sys/system_properties.h>
#include <GLES2/gl2.h>
@@ -15,6 +13,7 @@
#include <mbgl/platform/platform.hpp>
#include <mbgl/platform/event.hpp>
#include <mbgl/platform/log.hpp>
+#include <mbgl/util/std.hpp>
namespace mbgl {
namespace android {
@@ -194,7 +193,7 @@ bool NativeMapView::initializeDisplay() {
return false;
}
- const std::unique_ptr<EGLConfig[]> configs = boost::make_unique<EGLConfig[]>(num_configs); // switch to std::make_unique in C++14
+ const std::unique_ptr<EGLConfig[]> configs = mbgl::util::make_unique<EGLConfig[]>(num_configs);
if (!eglChooseConfig(display, config_attribs, configs.get(), num_configs, &num_configs)) {
mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig() returned error %d", eglGetError());
terminateDisplay();
diff --git a/platform/android/asset_request_baton_libzip.cpp b/platform/android/asset_request_baton_libzip.cpp
index 1d2f055bfa..6508f469db 100644
--- a/platform/android/asset_request_baton_libzip.cpp
+++ b/platform/android/asset_request_baton_libzip.cpp
@@ -2,8 +2,7 @@
#include <mbgl/storage/asset_request_baton.hpp>
#include <mbgl/storage/asset_request.hpp>
#include <mbgl/storage/response.hpp>
-
-#include <boost/make_unique.hpp>
+#include <mbgl/util/std.hpp>
#include <cerrno>
// NOTE a bug in the Android NDK breaks std::errno
@@ -28,7 +27,7 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) {
if ((apk == nullptr) || ptr->canceled || !ptr->request) {
// Opening the APK failed or was canceled. There isn't much left we can do.
const int message_size = zip_error_to_str(nullptr, 0, error, errno);
- const std::unique_ptr<char[]> message = boost::make_unique<char[]>(message_size);
+ const std::unique_ptr<char[]> message = mbgl::util::make_unique<char[]>(message_size);
zip_error_to_str(message.get(), 0, error, errno);
notify_error(ptr, 500, message.get());
cleanup(ptr);
@@ -61,7 +60,7 @@ void AssetRequestBaton::run(AssetRequestBaton *ptr) {
return;
}
- const std::unique_ptr<char[]> data = boost::make_unique<char[]>(stat.size);
+ const std::unique_ptr<char[]> data = mbgl::util::make_unique<char[]>(stat.size);
if (static_cast<zip_uint64_t>(zip_fread(apk_file, reinterpret_cast<void *>(data.get()), stat.size)) != stat.size || ptr->canceled || !ptr->request) {
// Reading failed or was canceled. We already have an open file handle
diff --git a/platform/default/http_request_baton_curl.cpp b/platform/default/http_request_baton_curl.cpp
index 9ddd5c501b..901ccbafd7 100644
--- a/platform/default/http_request_baton_curl.cpp
+++ b/platform/default/http_request_baton_curl.cpp
@@ -8,7 +8,6 @@
#ifdef __ANDROID__
#include <mbgl/android/jni.hpp>
#include <zip.h>
- #include <boost/make_unique.hpp>
#include <openssl/ssl.h>
#endif
@@ -447,7 +446,7 @@ static CURLcode sslctx_function(CURL */*curl*/, void *sslctx, void */*parm*/) {
return CURLE_SSL_CACERT_BADFILE;
}
- const std::unique_ptr<char[]> pem = boost::make_unique<char[]>(stat.size);
+ const std::unique_ptr<char[]> pem = util::make_unique<char[]>(stat.size);
if (static_cast<zip_uint64_t>(zip_fread(apk_file, reinterpret_cast<void *>(pem.get()), stat.size)) != stat.size) {
zip_fclose(apk_file);