[Pyrex] Pyrex idioms and optimizations?

Robert Bradshaw robertwb at math.washington.edu
Sun Jul 29 03:31:40 CEST 2007


Here's a patch that should resolve those two issues. Hopefully this  
is enough to get it to compile.

- Robert

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cython-non-gcc.patch
Type: application/octet-stream
Size: 2083 bytes
Desc: not available
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20070729/2c7fcbfa/attachment.obj 
-------------- next part --------------


On Jul 26, 2007, at 8:54 AM, Lenard Lindstrom wrote:

> Chris Mellon wrote:
>> On 7/26/07, William Stein <wstein at gmail.com> wrote:
>>
>>> On 7/26/07, Alexander Belchenko <bialix at ukr.net> wrote:
>>>
>>>> Here the lines that cause problems:
>>>>
>>>> line 30:
>>>>
>>>> static inline int __Pyx_PyObject_IsTrue(PyObject* x) {
>>>>    if (x == Py_True) return 1;
>>>>    else if (x == Py_False) return 0;
>>>>    else return PyObject_IsTrue(x);
>>>> }
>>>>
>>>> line 155 use macro
>>>> #define unlikely(x) __builtin_expect(!!(x), 0)
>>>> and __builtin_expect is somewhat gcc-specific, I guess.
>>>>
>>> Thanks for posting this.  I've put a copy in the todo list
>>> at http://cython.org.   I wonder, could you post the
>>> input .pyx file that you used or email it to me?
>>>
>>>
>>
>> MSVC is a C++ compiler, and only incidently a C compiler, so the
>> inline specifications that cython generates are syntax errors there.
>> Using a macro for it so it be a noop on MSVC would probably be best.
>>
> Is VC 7 C99 compliant? Maybe it needs some command line option set.
> Anyway "inline" is spelled "__inline" (two leading underscores) in  
> VC 6.
> That should still work.
>
> -- 
> Lenard Lindstrom
> <len-l at telus.net>
>
>
> _______________________________________________
> Pyrex mailing list
> Pyrex at lists.copyleft.no
> http://lists.copyleft.no/mailman/listinfo/pyrex



More information about the Pyrex mailing list