[Cython] long long and VC6
Michael Abshoff
michael.abshoff at googlemail.com
Sat Jan 3 00:22:07 CET 2009
Kirill Simonov wrote:
> Hi Robert,
Hi,
>>> I'm using Cython 0.10.3 to build an extension module and the
>>> generated C
>>> file does not compile under VC6, which I use to create a Windows
>>> binary
>>> package for Python 2.3. The culprit is the following expression:
>>>
>>> PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) :
>>> PyLong_FromUnsignedLongLong((sizeof(unsigned long long) >
>>> sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i);
>>>
>>> in the function __Pyx_GetItemInt. It looks like VC6 does not know
>>> about
>>> "long long". I suppose Cython should respect HAVE_LONG_LONG and use
>>> PY_LONG_LONG macro instead of "long long".
>> Hmm... I don't have any experience with VC6, but it looks like a bug
>> to me. Could you file a bug report on trac? Also, do you know if
>> PY_LONG_LONG guaranteed to be 64+ bits?
>
> I can't file a bug report, got Forbidden here:
>
> http://trac.cython.org/cython_trac/newticket
>
> I don't know about PY_LONG_LONG on 64+, but long long is C99, so I
> suppose it's a reasonably safe assumption.
I am not sure what Python 2.3 does, but the standard workaround for VC 6
is to define long long as __int64. But if PY_LONG_LONG is supported I
would obviously recommend to use that.
> Thanks,
> Kirill.
Cheers,
Michael
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev
>
More information about the Cython-dev
mailing list