python: Update 2.7.10 to 2.7.11 and 3.5.0 to 3.5.1
[termux-packages] / packages / python / mathmodule.c.patch
CommitLineData
59f0d218
FF
1The math module uses function pointers to math functions, which breaks
2using the system libm on ARM since we compile with -mhard-float.
3
4diff -u -r ../Python-3.4.3/Modules/mathmodule.c ./Modules/mathmodule.c
5--- ../Python-3.4.3/Modules/mathmodule.c 2015-02-25 06:27:46.000000000 -0500
6+++ ./Modules/mathmodule.c 2015-04-29 16:50:52.895371496 -0400
7@@ -727,7 +727,7 @@
8 */
9
10 static PyObject *
11-math_1_to_whatever(PyObject *arg, double (*func) (double),
12+math_1_to_whatever(PyObject *arg, __NDK_FPABI_MATH__ double (*func) (double),
13 PyObject *(*from_double_func) (double),
14 int can_overflow)
15 {
16@@ -765,7 +765,7 @@
17 errno = ERANGE for overflow). */
18
19 static PyObject *
20-math_1a(PyObject *arg, double (*func) (double))
21+math_1a(PyObject *arg, __NDK_FPABI_MATH__ double (*func) (double))
22 {
23 double x, r;
24 x = PyFloat_AsDouble(arg);
25@@ -808,19 +808,19 @@
26 */
27
28 static PyObject *
29-math_1(PyObject *arg, double (*func) (double), int can_overflow)
30+math_1(PyObject *arg, __NDK_FPABI_MATH__ double (*func) (double), int can_overflow)
31 {
32 return math_1_to_whatever(arg, func, PyFloat_FromDouble, can_overflow);
33 }
34
35 static PyObject *
36-math_1_to_int(PyObject *arg, double (*func) (double), int can_overflow)
37+math_1_to_int(PyObject *arg, __NDK_FPABI_MATH__ double (*func) (double), int can_overflow)
38 {
39 return math_1_to_whatever(arg, func, PyLong_FromDouble, can_overflow);
40 }
41
42 static PyObject *
43-math_2(PyObject *args, double (*func) (double, double), char *funcname)
44+math_2(PyObject *args, __NDK_FPABI_MATH__ double (*func) (double, double), char *funcname)
45 {
46 PyObject *ox, *oy;
47 double x, y, r;