Fix typecheck for SWIGTYPE.
This fixes the following bug:
Luigi Ballabio wrote:
> The following interface produces Guile wrappers which
> do not compile:
>
> %module Foo
> class Foo {};
> class Bar : public Foo {};
> void baz(Foo f);
>
> The reason seems to be the function baz() taking a Foo by value, which
> causes functions to be emitted in the CONVERSIONS section such as:
>
> static void *_BarTo_Foo(void *x) {
> return (void *)((Foo) ((Bar) x));
> }
> static void *_p_BarTo_p_Foo(void *x) {
> return (void *)((Foo *) ((Bar *) x));
> }
>
> of which the former doesn't compile; on the other hand, only the second
> function is emitted if baz() takes a Foo by const reference.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7266 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5b766d6fc0
commit
c0c0689298
1 changed files with 6 additions and 1 deletions
|
|
@ -330,11 +330,16 @@ typedef unsigned long SCM;
|
|||
$1 = SCM_STRINGP($input) ? 1 : 0;
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE {
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
|
||||
void *ptr;
|
||||
$1 = !SWIG_ConvertPtr($input, &ptr, $1_descriptor, 0);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE {
|
||||
void *ptr;
|
||||
$1 = !SWIG_ConvertPtr($input, &ptr, $&descriptor, 0);
|
||||
}
|
||||
|
||||
%typecheck(SWIG_TYPECHECK_VOIDPTR) void * {
|
||||
void *ptr;
|
||||
$1 = !SWIG_ConvertPtr($input, &ptr, 0, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue