File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ def check_api_version(apiversion, codegen_dir):
107107# sse headers only enabled automatically on amd64/x32 builds
108108 "xmmintrin.h" , # SSE
109109 "emmintrin.h" , # SSE2
110+ "features.h" , # for glibc version linux
110111]
111112
112113# optional gcc compiler builtins and their call arguments and optional a
Original file line number Diff line number Diff line change 44#include "config.h"
55#include "numpy/numpyconfig.h"
66
7- /* Disable broken MS math functions */
8- #if defined(_MSC_VER ) || defined(__MINGW32_VERSION )
9- #undef HAVE_ATAN2
10- #undef HAVE_HYPOT
11- #endif
12-
137/*
148 * largest alignment the copy loops might require
159 * required as string, void and complex types might get copied using larger
2115 */
2216#define NPY_MAX_COPY_ALIGNMENT 16
2317
18+ /* blacklist */
19+
2420/* Disable broken Sun Workshop Pro math functions */
2521#ifdef __SUNPRO_C
22+
23+ #undef HAVE_ATAN2
24+ #undef HAVE_ATAN2F
25+ #undef HAVE_ATAN2L
26+
27+ #endif
28+
29+ /* Disable broken MS math functions */
30+ #if defined(_MSC_VER ) || defined(__MINGW32_VERSION )
31+
2632#undef HAVE_ATAN2
33+ #undef HAVE_ATAN2F
34+ #undef HAVE_ATAN2L
35+
36+ #undef HAVE_HYPOT
37+ #undef HAVE_HYPOTF
38+ #undef HAVE_HYPOTL
39+
2740#endif
2841
42+ /* Disable broken gnu trig functions on linux */
43+ #if defined(__linux__ ) && defined(__GNUC__ )
44+
45+ #if defined(HAVE_FEATURES_H )
46+ #include <features.h>
47+ #define TRIG_OK __GLIBC_PREREQ(2, 16)
48+ #else
49+ #define TRIG_OK 0
50+ #endif
51+
52+ #if !TRIG_OK
53+ #undef HAVE_CASIN
54+ #undef HAVE_CASINF
55+ #undef HAVE_CASINL
56+ #undef HAVE_CASINH
57+ #undef HAVE_CASINHF
58+ #undef HAVE_CASINHL
59+ #undef HAVE_CATAN
60+ #undef HAVE_CATANF
61+ #undef HAVE_CATANL
62+ #undef HAVE_CATANH
63+ #undef HAVE_CATANHF
64+ #undef HAVE_CATANHL
65+ #endif
66+ #undef TRIG_OK
67+
68+ #endif /* defined(__linux__) && defined(__GNUC__) */
69+
2970#endif
You can’t perform that action at this time.
0 commit comments