[Numpy-discussion] Cython question

mark florisson markflorisson88@gmail....
Thu Feb 9 09:35:03 CST 2012


On 9 February 2012 15:29, Charles R Harris <charlesr.harris@gmail.com> wrote:
> Hi All,
>
> Does anyone know how to make Cython emit a C macro? I would like to be able
> to
>
> #define NO_DEPRECATED_API
>
> and can do so by including a header file or futzing with the generator
> script, but I was wondering if there was an easy way to do it in Cython.
>
> Chuck
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>

Best way is probably to include a C header file (cdef extern from
"myheader.h": pass), or define the macro with the 'define_macros'
argument to distutils' Extension. There are other tricks but they are
more hacks than anything else.


More information about the NumPy-Discussion mailing list