import source from 1.3.40
[external/swig.git] / Examples / test-suite / enum_template.i
1 %module enum_template
2
3 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) eTest0;        /* Ruby, wrong class name */
4 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) eTest1;        /* Ruby, wrong class name */
5 %warnfilter(SWIGWARN_RUBY_WRONG_NAME) eTest2;        /* Ruby, wrong class name */
6
7 /*
8 From bug report 992329:
9
10 In Python I see
11
12 >>> import enum_template
13 >>> enum_template.MakeETest()
14 '_60561408_p_ETest'
15 >>> enum_template.TakeETest(0)
16 Traceback (most recent call last):
17 File "<stdin>", line 1, in ?
18 TypeError: Expected a pointer
19
20 Without the %template, things work fine: the first
21 function call returns an integer, and the second
22 succeeds.
23 */
24
25 %inline %{
26
27 enum ETest
28 {
29 eTest0,
30 eTest1,
31 eTest2
32 };
33
34 void TakeETest(ETest test) {}
35 ETest MakeETest(void) {return eTest1;}
36
37 template<class T> class CTempl
38 {
39 };
40
41 %}
42
43 %template(CTempl_ETest) CTempl<ETest>;