1
0
Fork 0
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:
Nikolay Pultsin 2012-03-01 03:12:48 +00:00
parent 4eb420ecaa
commit f6452297c7
5 changed files with 38 additions and 2 deletions

View file

@ -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());
}