mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
synchronization with native branch
This commit is contained in:
parent
4eb420ecaa
commit
f6452297c7
5 changed files with 38 additions and 2 deletions
|
@ -66,7 +66,7 @@ JNIEnv *AndroidUtil::getEnv() {
|
|||
return env;
|
||||
}
|
||||
|
||||
#define CHECK_NULL(value) if ((value) == 0) { return false; }
|
||||
#define CHECK_NULL(value) if ((value) == 0) { throwRuntimeException(env, #value); }
|
||||
|
||||
bool AndroidUtil::init(JavaVM* jvm) {
|
||||
ourJavaVM = jvm;
|
||||
|
@ -167,3 +167,8 @@ std::string AndroidUtil::convertNonUtfString(const std::string &str) {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
void AndroidUtil::throwRuntimeException(JNIEnv *env, const std::string &message) {
|
||||
jclass cls = env->FindClass("java/lang/RuntimeException");
|
||||
env->ThrowNew(cls, message.c_str());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue