1 Don't use <fenv.h> on uClibc
3 The python-numpy code already has provisions to not use <fenv.h> when
4 not available. However, it uses __GLIBC__ to know whether fenv.h is
5 available or not, but uClibc defines __GLIBC__, so python-numpy thinks
8 This patch fixes that by changing all defined(__GLIBC__) occurences by
9 (defined(__GLIBC__) && !defined(__UCLIBC__)).
11 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13 Index: b/numpy/core/include/numpy/ufuncobject.h
14 ===================================================================
15 --- a/numpy/core/include/numpy/ufuncobject.h
16 +++ b/numpy/core/include/numpy/ufuncobject.h
18 (void) fpsetsticky(0); \
21 -#elif defined(__GLIBC__) || defined(__APPLE__) || \
22 +#elif (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
23 defined(__CYGWIN__) || defined(__MINGW32__) || \
24 (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
26 -#if defined(__GLIBC__) || defined(__APPLE__) || \
27 +#if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
28 defined(__MINGW32__) || defined(__FreeBSD__)
30 #elif defined(__CYGWIN__)
31 Index: b/numpy/core/src/npymath/ieee754.c.src
32 ===================================================================
33 --- a/numpy/core/src/npymath/ieee754.c.src
34 +++ b/numpy/core/src/npymath/ieee754.c.src
39 -#elif defined(__GLIBC__) || defined(__APPLE__) || \
40 +#elif (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
41 defined(__CYGWIN__) || defined(__MINGW32__) || \
42 (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
44 -# if defined(__GLIBC__) || defined(__APPLE__) || \
45 +# if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
46 defined(__MINGW32__) || defined(__FreeBSD__)
48 # elif defined(__CYGWIN__)
49 Index: b/numpy/numarray/_capi.c
50 ===================================================================
51 --- a/numpy/numarray/_capi.c
52 +++ b/numpy/numarray/_capi.c
54 #include <sys/param.h>
57 -#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
58 +#if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
60 #elif defined(__CYGWIN__)
61 #include "numpy/fenv/fenv.h"
65 /* Likewise for Integer overflows */
66 -#if defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
67 +#if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
68 static int int_overflow_error(Float64 value) { /* For x86_64 */
69 feraiseexcept(FE_OVERFLOW);
75 -#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
76 +#elif (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
79 NA_checkFPErrors(void)