1 |
dilfridge 11/11/13 12:04:42 |
2 |
|
3 |
Added: swig-2.0.4-typedef.patch |
4 |
Log: |
5 |
Backport upstream fix for bug 357483, acked by pchrist |
6 |
|
7 |
(Portage version: 2.1.10.34/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 dev-lang/swig/files/swig-2.0.4-typedef.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/swig/files/swig-2.0.4-typedef.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/swig/files/swig-2.0.4-typedef.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: swig-2.0.4-typedef.patch |
16 |
=================================================================== |
17 |
Index: Source/Swig/stype.c |
18 |
=================================================================== |
19 |
--- Source/Swig/stype.c (Revision 12813) |
20 |
+++ Source/Swig/stype.c (Revision 12814) |
21 |
@@ -823,7 +823,8 @@ |
22 |
Insert(result, 0, "("); |
23 |
Append(result, ")"); |
24 |
} |
25 |
- isreference = 1; |
26 |
+ if (!isfunction) |
27 |
+ isreference = 1; |
28 |
} else if (SwigType_isarray(element)) { |
29 |
DOH *size; |
30 |
if (firstarray && !isreference) { |
31 |
@@ -869,10 +870,8 @@ |
32 |
cast = NewStringf("(%s)", result); |
33 |
} |
34 |
if (name) { |
35 |
- if (!isfunction) { |
36 |
- if (isreference) { |
37 |
- Append(cast, "*"); |
38 |
- } |
39 |
+ if (isreference) { |
40 |
+ Append(cast, "*"); |
41 |
} |
42 |
Append(cast, name); |
43 |
} |
44 |
Index: Examples/test-suite/funcptr_cpp.i |
45 |
=================================================================== |
46 |
--- Examples/test-suite/funcptr_cpp.i (Revision 12813) |
47 |
+++ Examples/test-suite/funcptr_cpp.i (Revision 12814) |
48 |
@@ -20,3 +20,14 @@ |
49 |
%constant int (*ADD_BY_VALUE)(const int &, int) = addByValue; |
50 |
%constant int * (*ADD_BY_POINTER)(const int &, int) = addByPointer; |
51 |
%constant int & (*ADD_BY_REFERENCE)(const int &, int) = addByReference; |
52 |
+ |
53 |
+ |
54 |
+%inline %{ |
55 |
+typedef int AddByValueTypedef(const int &a, int b); |
56 |
+typedef int * AddByPointerTypedef(const int &a, int b); |
57 |
+typedef int & AddByReferenceTypedef(const int &a, int b); |
58 |
+void *typedef_call1(AddByValueTypedef *& precallback, AddByValueTypedef * postcallback) { return 0; } |
59 |
+void *typedef_call2(AddByPointerTypedef *& precallback, AddByPointerTypedef * postcallback) { return 0; } |
60 |
+void *typedef_call3(AddByReferenceTypedef *& precallback, AddByReferenceTypedef * postcallback) { return 0; } |
61 |
+%} |
62 |
+ |