~laney/ubuntu/quantal/swig2.0/guile-2.0

« back to all changes in this revision

Viewing changes to Examples/test-suite/dynamic_cast.i

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Landschoff
  • Date: 2010-12-19 18:25:59 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101219182559-8lh77o66bo890jwo
Tags: 2.0.1-1
* Merge new upstream release 2.0.1.
* Remove dependency on quilt and usage in debian/rules, the new source
  format will take care of that.
* Remove patch fix-cleaning.diff (applied upstream).
* Remove patch keep_docs.diff (applied upstream).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* File : example.i */
2
2
%module dynamic_cast
3
3
 
4
 
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
 
4
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP) && !defined(SWIGGO)
5
5
%apply SWIGTYPE *DYNAMIC { Foo * };
6
6
#endif
7
7
 
17
17
};
18
18
%}
19
19
 
20
 
#if defined(SWIGJAVA) || defined(SWIGCSHARP)
 
20
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGGO)
21
21
%typemap(out) Foo *blah {
22
22
    Bar *downcast = dynamic_cast<Bar *>($1);
23
23
    *(Bar **)&$result = downcast;
37
37
  }
38
38
#endif
39
39
 
 
40
#if defined(SWIGGO)
 
41
%insert(go_runtime) %{
 
42
func FooToBar(f Foo) Bar {
 
43
        return SwigcptrBar(f.Swigcptr())
 
44
}
 
45
%}
 
46
#endif
 
47
 
40
48
%inline %{
41
49
 
42
50
class Bar : public Foo {
54
62
}
55
63
%}
56
64
 
57
 
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
 
65
#if !defined(SWIGJAVA) && !defined(SWIGCSHARP) && !defined(SWIGGO)
58
66
// A general purpose function for dynamic casting of a Foo *
59
67
%{
60
68
static swig_type_info *