summaryrefslogtreecommitdiff
path: root/Lib/constraints.i
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2005-02-02 22:44:32 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2005-02-02 22:44:32 +0000
commitbac8f43f79c77660a94ba4d8b62103fe31efde26 (patch)
tree1343a145750ca906f635219b729fd5b2bfe2db25 /Lib/constraints.i
parentdf49ff9f1e63f107b96c90acbad57aabbbf657fa (diff)
downloadswig-bac8f43f79c77660a94ba4d8b62103fe31efde26.tar.gz
C# exception handling improvements - they are robust and don't leak anymore. Requires typemap modifications using attribute canthrow in any unmanaged code typemaps that throw an exception and excode attribute in csout and csconstruct typemaps.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6934 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/constraints.i')
-rw-r--r--Lib/constraints.i35
1 files changed, 26 insertions, 9 deletions
diff --git a/Lib/constraints.i b/Lib/constraints.i
index f2ffb4848..e85485b7d 100644
--- a/Lib/constraints.i
+++ b/Lib/constraints.i
@@ -66,9 +66,18 @@ If you have used typedef to change type-names, you can also do this :
%include exception.i
+#ifdef SWIGCSHARP
+// Required attribute for C# exception handling
+#define SWIGCSHARPCANTHROW , canthrow=1
+#else
+#define SWIGCSHARPCANTHROW
+#endif
+
+
// Positive numbers
-%typemap(check) int POSITIVE,
+%typemap(check SWIGCSHARPCANTHROW)
+ int POSITIVE,
short POSITIVE,
long POSITIVE,
unsigned int POSITIVE,
@@ -87,7 +96,8 @@ If you have used typedef to change type-names, you can also do this :
// Negative numbers
-%typemap(check) int NEGATIVE,
+%typemap(check SWIGCSHARPCANTHROW)
+ int NEGATIVE,
short NEGATIVE,
long NEGATIVE,
unsigned int NEGATIVE,
@@ -106,7 +116,8 @@ If you have used typedef to change type-names, you can also do this :
// Nonzero numbers
-%typemap(check) int NONZERO,
+%typemap(check SWIGCSHARPCANTHROW)
+ int NONZERO,
short NONZERO,
long NONZERO,
unsigned int NONZERO,
@@ -125,7 +136,8 @@ If you have used typedef to change type-names, you can also do this :
// Nonnegative numbers
-%typemap(check) int NONNEGATIVE,
+%typemap(check SWIGCSHARPCANTHROW)
+ int NONNEGATIVE,
short NONNEGATIVE,
long NONNEGATIVE,
unsigned int NONNEGATIVE,
@@ -144,7 +156,8 @@ If you have used typedef to change type-names, you can also do this :
// Nonpositive numbers
-%typemap(check) int NONPOSITIVE,
+%typemap(check SWIGCSHARPCANTHROW)
+ int NONPOSITIVE,
short NONPOSITIVE,
long NONPOSITIVE,
unsigned int NONPOSITIVE,
@@ -163,7 +176,8 @@ If you have used typedef to change type-names, you can also do this :
// Non-NULL pointer
-%typemap(check) void * NONNULL,
+%typemap(check SWIGCSHARPCANTHROW)
+ void * NONNULL,
Pointer NONNULL
{
if (!$1) {
@@ -173,7 +187,8 @@ If you have used typedef to change type-names, you can also do this :
// Aligned pointers
-%typemap(check) void * ALIGN8,
+%typemap(check SWIGCSHARPCANTHROW)
+ void * ALIGN8,
Pointer ALIGN8
{
long tmp;
@@ -183,7 +198,8 @@ If you have used typedef to change type-names, you can also do this :
}
}
-%typemap(check) void * ALIGN4,
+%typemap(check SWIGCSHARPCANTHROW)
+ void * ALIGN4,
Pointer ALIGN4
{
long tmp;
@@ -193,7 +209,8 @@ If you have used typedef to change type-names, you can also do this :
}
}
-%typemap(check) void * ALIGN2,
+%typemap(check SWIGCSHARPCANTHROW)
+ void * ALIGN2,
Pointer ALIGN2
{
long tmp;