From a10da324f8a5d4d7e68fdfcb6a63c420f3c4b99d Mon Sep 17 00:00:00 2001 From: cookedm Date: Tue, 15 May 2007 11:19:28 +0000 Subject: #513: fix up include of fenv.c in numarray for cygwin --- numpy/core/include/numpy/fenv/fenv.c | 2 +- numpy/core/include/numpy/fenv/fenv.h | 4 ++-- numpy/numarray/_capi.c | 17 +++++++---------- numpy/numarray/setup.py | 3 +-- 4 files changed, 11 insertions(+), 15 deletions(-) (limited to 'numpy') diff --git a/numpy/core/include/numpy/fenv/fenv.c b/numpy/core/include/numpy/fenv/fenv.c index b15ecdc2f..169642ce1 100644 --- a/numpy/core/include/numpy/fenv/fenv.c +++ b/numpy/core/include/numpy/fenv/fenv.c @@ -29,7 +29,7 @@ #include #include "fenv.h" -const fenv_t __fe_dfl_env = { +const fenv_t npy__fe_dfl_env = { 0xffff0000, 0xffff0000, 0xffffffff, diff --git a/numpy/core/include/numpy/fenv/fenv.h b/numpy/core/include/numpy/fenv/fenv.h index 792995b78..a1371770f 100644 --- a/numpy/core/include/numpy/fenv/fenv.h +++ b/numpy/core/include/numpy/fenv/fenv.h @@ -62,8 +62,8 @@ typedef __uint16_t fexcept_t; __BEGIN_DECLS /* Default floating-point environment */ -extern const fenv_t __fe_dfl_env; -#define FE_DFL_ENV (&__fe_dfl_env) +extern const fenv_t npy__fe_dfl_env; +#define FE_DFL_ENV (&npy__fe_dfl_env) #define __fldcw(__cw) __asm __volatile("fldcw %0" : : "m" (__cw)) #define __fldenv(__env) __asm __volatile("fldenv %0" : : "m" (__env)) diff --git a/numpy/numarray/_capi.c b/numpy/numarray/_capi.c index de4c4e508..0ba1be221 100644 --- a/numpy/numarray/_capi.c +++ b/numpy/numarray/_capi.c @@ -4,6 +4,13 @@ #include "numpy/libnumarray.h" #include +#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) +#include +#elif defined(__CYGWIN__) +#include "numpy/fenv/fenv.h" +#include "numpy/fenv/fenv.c" +#endif + static PyObject *pCfuncClass; static PyTypeObject CfuncType; static PyObject *pHandleErrorFunc; @@ -225,11 +232,6 @@ static int int_dividebyzero_error(long value, long unused) { /* Likewise for Integer overflows */ #if defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) -#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) -#include -#elif defined(__CYGWIN__) -#include "numpy/fenv/fenv.c" -#endif static int int_overflow_error(Float64 value) { /* For x86_64 */ feraiseexcept(FE_OVERFLOW); return (int) value; @@ -2938,11 +2940,6 @@ NA_checkFPErrors(void) } #elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) -#if defined(__GLIBC__) || defined(darwin) || defined(__MINGW32__) -#include -#elif defined(__CYGWIN__) -#include "numpy/fenv/fenv.h" -#endif static int NA_checkFPErrors(void) diff --git a/numpy/numarray/setup.py b/numpy/numarray/setup.py index c936400a1..69cd6bea1 100644 --- a/numpy/numarray/setup.py +++ b/numpy/numarray/setup.py @@ -6,9 +6,8 @@ def configuration(parent_package='',top_path=None): config.add_data_files('numpy/') - # Configure fftpack_lite config.add_extension('_capi', - sources=['_capi.c'] + sources=['_capi.c'], ) return config -- cgit v1.2.1