Use std::optional instead of mbgl::optional (#911)

This commit is contained in:
Bart Louwers
2023-03-17 12:51:59 +01:00
committed by GitHub
parent 36846439c6
commit 15ad65dd3d
482 changed files with 2605 additions and 2652 deletions

View File

@@ -20,12 +20,12 @@ bool attach_jni_thread(JavaVM* vm, JNIEnv** env, std::string threadName) {
ret = vm->GetEnv(reinterpret_cast<void **>(env), JNI_VERSION_1_6);
if (ret != JNI_OK) {
if (ret != JNI_EDETACHED) {
mbgl::Log::Error(mbgl::Event::JNI, "GetEnv() failed with %i", ret);
mbgl::Log::Error(mbgl::Event::JNI, "GetEnv() failed with " + std::to_string(ret));
throw std::runtime_error("GetEnv() failed");
} else {
ret = vm->AttachCurrentThread(env, &args);
if (ret != JNI_OK) {
mbgl::Log::Error(mbgl::Event::JNI, "AttachCurrentThread() failed with %i", ret);
mbgl::Log::Error(mbgl::Event::JNI, "AttachCurrentThread() failed with " + std::to_string(ret));
throw std::runtime_error("AttachCurrentThread() failed");
}
detach = true;
@@ -43,7 +43,7 @@ void detach_jni_thread(JavaVM* vm, JNIEnv** env, bool detach) {
jint ret;
if ((ret = vm->DetachCurrentThread()) != JNI_OK) {
mbgl::Log::Error(mbgl::Event::JNI, "DetachCurrentThread() failed with %i", ret);
mbgl::Log::Error(mbgl::Event::JNI, "DetachCurrentThread() failed with " + std::to_string(ret));
throw std::runtime_error("DetachCurrentThread() failed");
}
}