Johan Hake | 20 Nov 16:23

Bug in shared_ptr.i

Hello!

I have found a bug in shared_ptr.i, I think :P

In the toplevel user macro SWIG_SHARED_PTR_DERIVED it should not refer to

   SWIG_SHARED_PTR_NAMESPACE::shared_ptr

but rather

   SWIG_SHARED_PTR_QNAMESPACE::shared_ptr

I found this while trying to use boost_shared_ptr.i for wrapping std::tr1, 
which is explicitly said to be supported in the same file. It took me some 
time to figure out that you couldn't just use:

   #define SWIG_SHARED_PTR_NAMESPACE std::tr1

but that you have to use 

   #define SWIG_SHARED_PTR_NAMESPACE std
   #define SWIG_SHARED_PTR_SUBNAMESPACE tr1

and then it took some more hours to figure out the bug I am reporting.

Thanks for a great program!

Johan Hake

p.s. a diff is attached showing the change to 'shared_ptr.i'
(Continue reading)

Johan Hake | 21 Nov 09:03

Re: Bug in shared_ptr.i

Hello again!

I filed a bug (#2319790) including a patch resolving the bug.

Johan

On Thursday 20 November 2008 16:26:54 Johan Hake wrote:
> Hello!
>
> I have found a bug in shared_ptr.i, I think :P
>
> In the toplevel user macro SWIG_SHARED_PTR_DERIVED it should not refer to
>
>    SWIG_SHARED_PTR_NAMESPACE::shared_ptr
>
> but rather
>
>    SWIG_SHARED_PTR_QNAMESPACE::shared_ptr
>
> I found this while trying to use boost_shared_ptr.i for wrapping std::tr1,
> which is explicitly said to be supported in the same file. It took me some
> time to figure out that you couldn't just use:
>
>    #define SWIG_SHARED_PTR_NAMESPACE std::tr1
>
> but that you have to use
>
>    #define SWIG_SHARED_PTR_NAMESPACE std
>    #define SWIG_SHARED_PTR_SUBNAMESPACE tr1
>
(Continue reading)


Gmane