summaryrefslogtreecommitdiffstats
path: root/src/bind/dobinding.cpp
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2008-03-12 20:05:45 +0000
committerishmal <ishmal@users.sourceforge.net>2008-03-12 20:05:45 +0000
commit47676080bbf948ce70a70d2bfbd4a1b2eb2b4995 (patch)
tree4a2fdc61909d7ff13210ce8f5f03677af2994e62 /src/bind/dobinding.cpp
parentSplit getException into method and function, so it can be used in native func... (diff)
downloadinkscape-47676080bbf948ce70a70d2bfbd4a1b2eb2b4995.tar.gz
inkscape-47676080bbf948ce70a70d2bfbd4a1b2eb2b4995.zip
Split getException into method and function, so it can be used in native functions.
(bzr r5070)
Diffstat (limited to 'src/bind/dobinding.cpp')
-rw-r--r--src/bind/dobinding.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bind/dobinding.cpp b/src/bind/dobinding.cpp
index e2157de0b..639e27062 100644
--- a/src/bind/dobinding.cpp
+++ b/src/bind/dobinding.cpp
@@ -66,6 +66,10 @@ typedef struct
JNINativeMethod *methods;
} NativeClass;
+/**
+ * Although I dislike macros, this one seems reasonable
+ */
+#define EXCEPTION (getExceptionString(env).c_str())
//########################################################################
//# BASE OBJECT
@@ -76,7 +80,7 @@ static jlong getPointer(JNIEnv *env, jobject obj)
jfieldID id = env->GetFieldID(env->GetObjectClass(obj), "_pointer", "J");
if (!id)
{
- err("getPointer: %s", getException(env).c_str());
+ err("getPointer: %s", EXCEPTION);
return 0;
}
jlong val = env->GetLongField(obj, id);
@@ -88,7 +92,7 @@ static void setPointer(JNIEnv *env, jobject obj, jlong val)
jfieldID id = env->GetFieldID(env->GetObjectClass(obj), "_pointer", "J");
if (!id)
{
- err("setPointer: %s", getException(env).c_str());
+ err("setPointer: %s", EXCEPTION);
return;
}
env->SetLongField(obj, id, val);