[Xapian-discuss] problem building python bindings
Marcus Rueckert
darix at web.de
Tue Aug 21 18:56:16 BST 2007
On 2007-08-21 17:50:07 +0100, James Aylett wrote:
> Date: Tue, 21 Aug 2007 17:50:07 +0100
> From: James Aylett <james-xapian at tartarus.org>
> Subject: Re: [Xapian-discuss] problem building python bindings
> To: xapian-discuss at lists.xapian.org
> Mail-Followup-To: xapian-discuss at lists.xapian.org
> X-DSPAM-Result: Whitelisted
> X-DSPAM-Confidence: 0.9906
> X-DSPAM-Probability: 0.0000
>
> On Tue, Aug 21, 2007 at 06:42:46PM +0200, Marcus Rueckert wrote:
>
> > > Can you find what that Py type is typedef to?
> >
> > object.h:typedef Py_ssize_t (*lenfunc)(PyObject *)
>
> No, that's a typedef for lenfunc as a function pointer. C is fun like
> that :)
sorry
> It's actually:
>
> pyport.h:typedef ssize_t Py_ssize_t;
>
> which makes sense. ssize_t is __darwin_ssize_t, which is long. Which
> again makes sense.
>
> Okay, I've forgotten the context. But something it trying to cast
> (int*) and (long*) to each other somehow. It should work one way, it
> won't work the other. I suspect that hacking the file in question to
> replace (int*) with (long*) or (Py_ssize_t*) will fix it.
no. imho the real fix would be using ssize_t in the xapian/swig code in
first place. so you dont overrun it by accident on 64bit architectures.
or cut off the wrong part when assigning a long to this int on bigendian
64bit.
darix
--
openSUSE - SUSE Linux is my linux
openSUSE is good for you
www.opensuse.org
More information about the Xapian-discuss
mailing list