Skip to content

Commit 3c25afb

Browse files
committed
pythongh-112019: reversion of removal _Py_c_* functions in python#106339
1 parent 12a30bc commit 3c25afb

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

Include/cpython/complexobject.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ typedef struct {
77
double imag;
88
} Py_complex;
99

10+
/* Operations on complex numbers from complexmodule.c */
11+
12+
PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
13+
PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
14+
PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
15+
PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
16+
PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
17+
PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
18+
PyAPI_FUNC(double) _Py_c_abs(Py_complex);
19+
1020
/* Complex object interface */
1121

1222
/*

Include/internal/pycore_complexobject.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ extern "C" {
1010

1111
#include "pycore_unicodeobject.h" // _PyUnicodeWriter
1212

13-
// Operations on complex numbers.
14-
// Export functions for 'cmath' shared extension.
15-
PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
16-
PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
17-
PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
18-
PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
19-
PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
20-
PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
21-
PyAPI_FUNC(double) _Py_c_abs(Py_complex);
22-
2313
/* Format the object based on the format_spec, as defined in PEP 3101
2414
(Advanced String Formatting). */
2515
extern int _PyComplex_FormatAdvancedWriter(

Modules/cmathmodule.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#endif
88

99
#include "Python.h"
10-
#include "pycore_complexobject.h" // _Py_c_neg()
1110
#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR
1211
/* we need DBL_MAX, DBL_MIN, DBL_EPSILON, DBL_MANT_DIG and FLT_RADIX from
1312
float.h. We assume that FLT_RADIX is either 2 or 16. */

0 commit comments

Comments
 (0)