Update for C#

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4898 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2003-06-12 13:01:36 +00:00
commit 53862f4f5f

View file

@ -1,7 +1,7 @@
/* File : example.i */
%module dynamic_cast
#ifndef SWIGJAVA
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
%apply SWIGTYPE *DYNAMIC { Foo * };
#endif
@ -15,17 +15,25 @@ public:
};
%}
#ifdef SWIGJAVA
#if defined(SWIGJAVA) || defined(SWIGCSHARP)
%typemap(out) Foo *blah {
Bar *downcast = dynamic_cast<Bar *>($1);
*(Bar **)&$result = downcast;
}
#endif
#if defined(SWIGJAVA)
%typemap(javaout) Foo * {
return new Bar($jnicall, $owner);
}
#endif
#if defined(SWIGCSHARP)
%typemap(csout) Foo * {
return new Bar($imcall, $owner);
}
#endif
%inline %{
class Bar : public Foo {
@ -43,7 +51,7 @@ char *do_test(Bar *b) {
}
%}
#ifndef SWIGJAVA
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
// A general purpose function for dynamic casting of a Foo *
%{
static swig_type_info *