Markus Wörle
2006-Nov-19 19:01 UTC
[Xapian-discuss] Search::Xapian::BoolWeight constructor problem
Hi! After upgrading from xapian 0.9.6 to xapian 0.9.9 (including perl bindings) I get this error when I'm trying to create an instance of BoolWeight: my $bool = Search::Xapian::BoolWeight->new(); throws: Usage: Search::Xapian::BoolWeight::new() at ... Using Search::Xapian::BoolWeight::new() instead of "Search::Xapian::BoolWeight->new()" works, but it feels quite unfamiliar to me. I neighter know C++ nor XS very well, but it seems that there is either a wrapper missing, from perl new() to XS new1() (in which case the XS new() would have to be renamed to new1()), or there is a class-method (new()) instead of an object-method (BoolWeight::new()) in XS/BoolWeight.xs. Regards, mrks
Olly Betts
2006-Nov-21 05:53 UTC
[Xapian-discuss] Search::Xapian::BoolWeight constructor problem
On Sun, Nov 19, 2006 at 08:01:21PM +0100, Markus W?rle wrote:> I neighter know C++ nor XS very well, but it seems that there is either > a wrapper missing, from perl new() to XS new1() (in which case the XS > new() would have to be renamed to new1()), or there is a class-method > (new()) instead of an object-method (BoolWeight::new()) in > XS/BoolWeight.xs.I XS/BoolWeight.xs in 0.9.9.0, but the SVN commit message doesn't help me remember why. Could you try the attached patch. If that works I'll commit this and add a test-case. Cheers, Olly -------------- next part -------------- Index: XS/BoolWeight.xs ==================================================================--- XS/BoolWeight.xs (revision 65) +++ XS/BoolWeight.xs (working copy) @@ -3,7 +3,7 @@ PROTOTYPES: ENABLE BoolWeight * -new() +BoolWeight::new() CODE: RETVAL = new BoolWeight(); OUTPUT: