[Numpy-discussion] How to include numpy headers in C across versions 1.1, 1.2, and 1.3

Peter Wang pwang at enthought.com
Mon May 11 18:49:02 EDT 2009


Hey guys,

I've got a small C extension that uses isnan() and (in numpy 1.1) had  
been importing it from ufuncobject.h.  I see that it has now moved  
into npy_math.h in 1.3.

What is the best way to ensure that I can reliably include this  
function across versions 1.1, 1.2, and 1.3?  (Checking  
NPY_FEATURE_VERSION won't work, since it did not change from 1.2 to  
1.3, although the location of the function definition did.)

My best idea right now is to simply do a numpy version check in my  
setup.py, and hard-code some macros at the top of my C extension to  
#include the appropriate headers for each version.

Any help or suggestions would be appreciated!

Thanks,
Peter




More information about the NumPy-Discussion mailing list