lbry-android/p4a/pythonforandroid/recipes/python3/patches-termux/mathmodule.c.patch

48 lines
1.6 KiB
Diff
Raw Normal View History

2017-08-13 03:24:00 +02:00
The math module uses function pointers to math functions, which breaks
using the system libm on ARM since we compile with -mhard-float.
diff -u -r ../Python-3.4.3/Modules/mathmodule.c ./Modules/mathmodule.c
--- ../Python-3.4.3/Modules/mathmodule.c 2015-02-25 06:27:46.000000000 -0500
+++ ./Modules/mathmodule.c 2015-04-29 16:50:52.895371496 -0400
@@ -727,7 +727,7 @@
*/
static PyObject *
-math_1_to_whatever(PyObject *arg, double (*func) (double),
+math_1_to_whatever(PyObject *arg, __NDK_FPABI_MATH__ double (*func) (double),
PyObject *(*from_double_func) (double),
int can_overflow)
{
@@ -765,7 +765,7 @@
errno = ERANGE for overflow). */
static PyObject *
-math_1a(PyObject *arg, double (*func) (double))
+math_1a(PyObject *arg, __NDK_FPABI_MATH__ double (*func) (double))
{
double x, r;
x = PyFloat_AsDouble(arg);
@@ -808,19 +808,19 @@
*/
static PyObject *
-math_1(PyObject *arg, double (*func) (double), int can_overflow)
+math_1(PyObject *arg, __NDK_FPABI_MATH__ double (*func) (double), int can_overflow)
{
return math_1_to_whatever(arg, func, PyFloat_FromDouble, can_overflow);
}
static PyObject *
-math_1_to_int(PyObject *arg, double (*func) (double), int can_overflow)
+math_1_to_int(PyObject *arg, __NDK_FPABI_MATH__ double (*func) (double), int can_overflow)
{
return math_1_to_whatever(arg, func, PyLong_FromDouble, can_overflow);
}
static PyObject *
-math_2(PyObject *args, double (*func) (double, double), char *funcname)
+math_2(PyObject *args, __NDK_FPABI_MATH__ double (*func) (double, double), char *funcname)
{
PyObject *ox, *oy;
double x, y, r;