Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add exception support in csharp (fixes warnings about missing excode …
…in csout typemap)
  • Loading branch information
Soeren Sonnenburg committed Aug 27, 2011
1 parent 3c81fe4 commit bd140da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/interfaces/csharp_modular/swig_typemaps.i
Expand Up @@ -58,7 +58,7 @@
}

%typemap(csin) shogun::SGVector<SGTYPE> "$csinput.Length, $csinput"
%typemap(csout) shogun::SGVector<SGTYPE> {
%typemap(csout, excode=SWIGEXCODE) shogun::SGVector<SGTYPE> {
IntPtr ptr = $imcall;$excode
int[] size = new int[1];
Marshal.Copy(ptr, size, 0, 1);
Expand Down Expand Up @@ -140,7 +140,7 @@ TYPEMAP_SGVECTOR(float64_t, double, double)
}

%typemap(csin) shogun::SGMatrix<SGTYPE> "$csinput.GetLength(0), $csinput.GetLength(1), $csinput"
%typemap(csout) shogun::SGMatrix<SGTYPE> {
%typemap(csout, excode=SWIGEXCODE) shogun::SGMatrix<SGTYPE> {
IntPtr ptr = $imcall;$excode
int[] ranks = new int[2];
Marshal.Copy(ptr, ranks, 0, 2);
Expand Down Expand Up @@ -241,7 +241,7 @@ TYPEMAP_SGMATRIX(float64_t, double, double)
}

%typemap(csin) shogun::SGStringList<SGTYPE> "$csinput.GetLength(0), $csinput.GetLength(1), $csinput"
%typemap(csout) shogun::SGStringList<SGTYPE> {
%typemap(csout, excode=SWIGEXCODE) shogun::SGStringList<SGTYPE> {
IntPtr ptr = $imcall;$excode
CSHARPTYPE[] ranks = new CSHARPTYPE[2];
Marshal.Copy(ptr, ranks, 0, 2);
Expand Down Expand Up @@ -333,7 +333,7 @@ TYPEMAP_STRINGFEATURES(float64_t, double, double)
}

%typemap(csin) shogun::SGStringList<char> "$csinput.Length, $csinput"
%typemap(csout) shogun::SGStringList<char> {
%typemap(csout, excode=SWIGEXCODE) shogun::SGStringList<char> {
IntPtr ptr = $imcall;$excode

IntPtr[] ranks = new IntPtr[1];
Expand Down

0 comments on commit bd140da

Please sign in to comment.