From 5a0ab023d8f81ccf83fe6adf7983d7631021cb62 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Wed, 6 Oct 2010 01:15:15 +0200 Subject: BUG: core: use #if check instead of #ifdef in checking HAVE_DECL_ISFINITE (ticket #1625) Python #defines HAVE_DECL_ISFINITE 0 when the function is not available, so the proper check to do is #if. --- numpy/core/setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'numpy/core/setup.py') diff --git a/numpy/core/setup.py b/numpy/core/setup.py index ad8d5cb3b..f71ec108a 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -215,10 +215,13 @@ def check_ieee_macros(config): _macros = ["isnan", "isinf", "signbit", "isfinite"] if sys.version_info[:2] >= (2, 6): for f in _macros: - already_declared = config.check_decl(fname2def("decl_%s" % f), + py_symbol = fname2def("decl_%s" % f) + already_declared = config.check_decl(py_symbol, headers=["Python.h", "math.h"]) if already_declared: - pub.append('NPY_%s' % fname2def("decl_%s" % f)) + if config.check_macro_true(py_symbol, + headers=["Python.h", "math.h"]): + pub.append('NPY_%s' % fname2def("decl_%s" % f)) else: macros.append(f) else: -- cgit v1.2.1