8000 Fix building on freebsd [patch by Joe Peterson]. · numpy/numpy@d3c469c · GitHub
[go: up one dir, main page]

Skip to content

Commit d3c469c

Browse files
committed
Fix building on freebsd [patch by Joe Peterson].
1 parent dd955bd commit d3c469c

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

numpy/core/include/numpy/ufuncobject.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ typedef struct _loop1d_info {
223223
/* This code checks the IEEE status flags in a platform-dependent way */
224224
/* Adapted from Numarray */
225225

226+
#if (defined(__unix__) || defined(unix)) && !defined(USG)
227+
#include <sys/param.h>
228+
#endif
229+
226230
/* OSF/Alpha (Tru64) ---------------------------------------------*/
227231
#if defined(__osf__) && defined(__alpha)
228232

@@ -267,7 +271,7 @@ typedef struct _loop1d_info {
267271
/* Solaris --------------------------------------------------------*/
268272
/* --------ignoring SunOS ieee_flags approach, someone else can
269273
** deal with that! */
270-
#elif defined(sun) || defined(__BSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
274+
#elif defined(sun) || defined(__BSD__) || defined(__OpenBSD__) || (defined(__FreeBSD__) && (__FreeBSD_version < 502114)) || defined(__NetBSD__)
271275
#include <ieeefp.h>
272276

273277
#define UFUNC_CHECK_STATUS(ret) { \
@@ -281,9 +285,9 @@ typedef struct _loop1d_info {
281285
(void) fpsetsticky(0); \
282286
}
283287

284-
#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__)
288+
#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
285289

286-
#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__)
290+
#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) || defined(__FreeBSD__)
287291
#include <fenv.h>
288292
#elif defined(__CYGWIN__)
289293
#include "fenv/fenv.c"

numpy/numarray/_capi.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
#include "numpy/libnumarray.h"
55
#include <float.h>
66

7-
#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__)
7+
#if (defined(__unix__) || defined(unix)) && !defined(USG)
8+
#include <sys/param.h>
9+
#endif
10+
11+
#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
812
#include <fenv.h>
913
#elif defined(__CYGWIN__)
1014
#include "numpy/fenv/fenv.h"
@@ -231,7 +235,7 @@ static int int_dividebyzero_error(long value, long unused) {
231235
}
232236

233237
/* Likewise for Integer overflows */
234-
#if defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__)
238+
#if defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
235239
static int int_overflow_error(Float64 value) { /* For x86_64 */
236240
feraiseexcept(FE_OVERFLOW);
237241
return (int) value;
@@ -2939,7 +2943,7 @@ NA_checkFPErrors(void)
29392943
return retstatus;
29402944
}
29412945

2942-
#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__)
2946+
#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
29432947

29442948
static int
29452949
NA_checkFPErrors(void)

0 commit comments

Comments
 (0)
0