summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2011-03-17 17:15:49 +0000
committerSilenio Quarti <silenio>2011-03-17 17:15:49 +0000
commitd1c3f57204e67ce1ff35122330fba5286431872b (patch)
tree8cc9a34ee10bf5c48017a93412c9aa60d80cd550 /bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java
parent1e6f41a2ef164aa97b73275b497a27865ff8c74f (diff)
downloadeclipse.platform.swt-d1c3f57204e67ce1ff35122330fba5286431872b.tar.gz
eclipse.platform.swt-d1c3f57204e67ce1ff35122330fba5286431872b.tar.xz
eclipse.platform.swt-d1c3f57204e67ce1ff35122330fba5286431872b.zip
adding support to generate try/catch blocks
Diffstat (limited to 'bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java')
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java
index e0c5d00972..f162dd61a7 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java
@@ -415,6 +415,7 @@ void generateSetParameter(JNIParameter param, boolean critical) {
void generateEnterExitMacro(JNIMethod method, String function, String function64, boolean enter) {
if (!enterExitMacro) return;
+ boolean tryCatch = method.getFlag(FLAG_TRYCATCH);
if (!function.equals(function64)) {
output("#ifndef ");
output(JNI64);
@@ -424,6 +425,7 @@ void generateEnterExitMacro(JNIMethod method, String function, String function64
output(method.getDeclaringClass().getSimpleName());
output("_NATIVE_");
output(enter ? "ENTER" : "EXIT");
+ if (tryCatch) output(enter ? "_TRY" : "_CATCH");
output("(env, that, ");
output(function);
outputln("_FUNC);");
@@ -433,6 +435,7 @@ void generateEnterExitMacro(JNIMethod method, String function, String function64
output(method.getDeclaringClass().getSimpleName());
output("_NATIVE_");
output(enter ? "ENTER" : "EXIT");
+ if (tryCatch) output(enter ? "_TRY" : "_CATCH");
output("(env, that, ");
output(function64);
outputln("_FUNC);");