[Cython] Exporting inline functions from a pyx.

Jesus-Omar Ocegueda-Gonzalez jomaroceguedag at gmail.com
Wed May 27 04:17:40 CEST 2015


Dear Cython developers,
thanks for the awesome compiler!, we recently faced an issue exporting
inline functions defined in a .pyx. According to this:
http://docs.cython.org/src/tutorial/pxd_files.html
the full inline definition (not just the declaration) should be in the pxd.
However, if we put the definition in the .pyx and just its declaration
header in the .pxd,  Cython declares a pointer to the inline function
similar to:

static CYTHON_INLINE double (*__function_name)(...); /*proto*/

but this causes a compilation error in some platforms (but successfully
compiles in others) because variables cannot be declare as inline. You can
find a log with the compilation errors here:
http://nipy.bic.berkeley.edu/builders/dipy-py2.7-osx-10.8/builds/362/steps/shell_5/logs/stdio

I guess it should be possible to detect when a function is inline and in
that case remove the CYTHON_INLINE from the pointer declaration, or at
least consistently fail in all platforms. Is this a known issue?

Thank you very much!
With warm regards,
-Omar.
-- 
"Cada quien es dueño de lo que calla y esclavo de lo que dice"
-Proverbio chino.
"We all are owners of what we keep silent and slaves of what we say"
-Chinese proverb.

http://www.cimat.mx/~omar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20150526/12aff49f/attachment.html>


More information about the cython-devel mailing list