[Numpy-discussion] Cython question

Charles R Harris charlesr.harris@gmail....
Thu Feb 9 10:05:14 CST 2012


On Thu, Feb 9, 2012 at 8:35 AM, mark florisson <markflorisson88@gmail.com>wrote:

> 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.
>

Thanks Mark,

The header file looks like the cleanest way to do this. I'll put one in the
numpy/include/numpy directory.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120209/91ef3077/attachment.html 


More information about the NumPy-Discussion mailing list