From c471f1ed46949a9871cfc293361a29a617920e9f Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 31 May 2004 07:22:46 +0000 Subject: [PATCH] various tweaks git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5957 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/csharp/enums.swg | 4 ++-- Lib/csharp/enumsimple.swg | 4 ++-- Lib/java/enumsimple.swg | 9 ++------- Lib/java/enumtypeunsafe.swg | 11 +++-------- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Lib/csharp/enums.swg b/Lib/csharp/enums.swg index 8878b2b3b..955bc3845 100644 --- a/Lib/csharp/enums.swg +++ b/Lib/csharp/enums.swg @@ -12,9 +12,9 @@ %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" -%typemap(throws) enum SWIGTYPE { +%typemap(throws) enum SWIGTYPE %{ SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown"); -} +%} %typemap(csin) enum SWIGTYPE "(int)$csinput" %typemap(csout) enum SWIGTYPE { diff --git a/Lib/csharp/enumsimple.swg b/Lib/csharp/enumsimple.swg index 23cc67433..b65a42a8e 100644 --- a/Lib/csharp/enumsimple.swg +++ b/Lib/csharp/enumsimple.swg @@ -14,9 +14,9 @@ %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" -%typemap(throws) enum SWIGTYPE { +%typemap(throws) enum SWIGTYPE %{ SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown"); -} +%} %typemap(csin) enum SWIGTYPE "$csinput" %typemap(csout) enum SWIGTYPE { diff --git a/Lib/java/enumsimple.swg b/Lib/java/enumsimple.swg index 257cfa8e2..983812293 100644 --- a/Lib/java/enumsimple.swg +++ b/Lib/java/enumsimple.swg @@ -18,14 +18,9 @@ %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -%typemap(throws) enum SWIGTYPE { +%typemap(throws) enum SWIGTYPE %{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); -} +%} %typemap(javain) enum SWIGTYPE "$javainput" %typemap(javaout) enum SWIGTYPE { diff --git a/Lib/java/enumtypeunsafe.swg b/Lib/java/enumtypeunsafe.swg index c5c1cfb43..8487e7d93 100644 --- a/Lib/java/enumtypeunsafe.swg +++ b/Lib/java/enumtypeunsafe.swg @@ -18,14 +18,9 @@ %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE "" -%typemap(javain) enum SWIGTYPE "$javainput.swigValue()" -%typemap(javaout) enum SWIGTYPE { - return $javaclassname.swigToEnum($jnicall); - } - -%typemap(throws) enum SWIGTYPE { +%typemap(throws) enum SWIGTYPE %{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); -} +%} %typemap(javain) enum SWIGTYPE "$javainput" %typemap(javaout) enum SWIGTYPE { @@ -33,7 +28,7 @@ } // '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not -%typemap(javaclassmodifiers) enum SWIGTYPE "public $static class" +%typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class" %typemap(javagetcptr) enum SWIGTYPE "" %javaenum(typeunsafe);