diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/include/numpy/ufuncobject.h | 10 | ||||
-rw-r--r-- | numpy/numarray/_capi.c | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h index 36da30360..cf868446b 100644 --- a/numpy/core/include/numpy/ufuncobject.h +++ b/numpy/core/include/numpy/ufuncobject.h @@ -223,6 +223,10 @@ typedef struct _loop1d_info { /* This code checks the IEEE status flags in a platform-dependent way */ /* Adapted from Numarray */ +#if (defined(__unix__) || defined(unix)) && !defined(USG) +#include <sys/param.h> +#endif + /* OSF/Alpha (Tru64) ---------------------------------------------*/ #if defined(__osf__) && defined(__alpha) @@ -267,7 +271,7 @@ typedef struct _loop1d_info { /* Solaris --------------------------------------------------------*/ /* --------ignoring SunOS ieee_flags approach, someone else can ** deal with that! */ -#elif defined(sun) || defined(__BSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) +#elif defined(sun) || defined(__BSD__) || defined(__OpenBSD__) || (defined(__FreeBSD__) && (__FreeBSD_version < 502114)) || defined(__NetBSD__) #include <ieeefp.h> #define UFUNC_CHECK_STATUS(ret) { \ @@ -281,9 +285,9 @@ typedef struct _loop1d_info { (void) fpsetsticky(0); \ } -#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) +#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114)) -#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) +#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) || defined(__FreeBSD__) #include <fenv.h> #elif defined(__CYGWIN__) #include "fenv/fenv.c" diff --git a/numpy/numarray/_capi.c b/numpy/numarray/_capi.c index 0ba1be221..07fcc0c2d 100644 --- a/numpy/numarray/_capi.c +++ b/numpy/numarray/_capi.c @@ -4,7 +4,11 @@ #include "numpy/libnumarray.h" #include <float.h> -#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) +#if (defined(__unix__) || defined(unix)) && !defined(USG) +#include <sys/param.h> +#endif + +#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114)) #include <fenv.h> #elif defined(__CYGWIN__) #include "numpy/fenv/fenv.h" @@ -231,7 +235,7 @@ 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(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114)) static int int_overflow_error(Float64 value) { /* For x86_64 */ feraiseexcept(FE_OVERFLOW); return (int) value; @@ -2939,7 +2943,7 @@ NA_checkFPErrors(void) return retstatus; } -#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) +#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114)) static int NA_checkFPErrors(void) |