[Numpy-svn] r6390 - branches/coremath/numpy/core

numpy-svn@scip... numpy-svn@scip...
Wed Feb 18 11:28:14 CST 2009


Author: cdavid
Date: 2009-02-18 11:28:03 -0600 (Wed, 18 Feb 2009)
New Revision: 6390

Modified:
   branches/coremath/numpy/core/setup.py
Log:
Check for isinf and co declarations for numpyconfig.h as well, this it will be needed for npy_math.

Modified: branches/coremath/numpy/core/setup.py
===================================================================
--- branches/coremath/numpy/core/setup.py	2009-02-18 17:27:26 UTC (rev 6389)
+++ branches/coremath/numpy/core/setup.py	2009-02-18 17:28:03 UTC (rev 6390)
@@ -286,6 +286,18 @@
 
             moredefs = []
 
+            # Normally, isnan and isinf are macro (C99), but some platforms
+            # only have func, or both func and macro version. Check for macro
+            # only, and define replacement ones if not found.
+            # Note: including Python.h is necessary because it modifies some
+            # math.h definitions
+            # XXX: we check those twice... should decouple tests from
+            # config.h/numpyconfig.h to avoid this
+            for f in ["isnan", "isinf", "signbit", "isfinite"]:
+                st = config_cmd.check_decl(f, headers = ["Python.h", "math.h"])
+                if st:
+                    moredefs.append('NPY_HAVE_DECL_%s' % f.upper())
+
             # Check wether we can use inttypes (C99) formats
             if config_cmd.check_decl('PRIdPTR', headers = ['inttypes.h']):
                 moredefs.append(('NPY_USE_C99_FORMATS', 1))



More information about the Numpy-svn mailing list