~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-09-01 18:35:55 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050901183555-eq59uwhq8b62e44c
Tags: 1.3.24-1ubuntu4
* Use php5-dev instead of php4-dev, to kick php4 out of main.
* Drop support for generation of pike bindings, as nothing uses it,
  and swig is the only thing keeping pike7.6 in main (Ubuntu #13796)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%module enum_template
 
2
 
 
3
%warnfilter(801) eTest0;        /* Ruby, wrong class name */
 
4
%warnfilter(801) eTest1;        /* Ruby, wrong class name */
 
5
%warnfilter(801) 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>;