diff options
author | Victor Stinner <vstinner@python.org> | 2022-02-23 17:16:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 17:16:23 (GMT) |
commit | 9bbdde218005f552304d9954bb97e3f9185edded (patch) | |
tree | 2085d4399dfdcb03bbf9af4c7e5cf92bbdb55f43 /Include/internal/pycore_dtoa.h | |
parent | 375a56bd4015596c0cf44129c8842a1fe7199785 (diff) | |
download | cpython-9bbdde218005f552304d9954bb97e3f9185edded.zip cpython-9bbdde218005f552304d9954bb97e3f9185edded.tar.gz cpython-9bbdde218005f552304d9954bb97e3f9185edded.tar.bz2 |
bpo-45412: Add _PY_SHORT_FLOAT_REPR macro (GH-31171)
Remove the HAVE_PY_SET_53BIT_PRECISION macro (moved to the internal
C API).
* Move HAVE_PY_SET_53BIT_PRECISION macro to pycore_pymath.h.
* Replace PY_NO_SHORT_FLOAT_REPR macro with _PY_SHORT_FLOAT_REPR
macro which is always defined. gcc -Wundef emits a warning when
using _PY_SHORT_FLOAT_REPR but the macro is not defined, if
pycore_pymath.h include was forgotten.
Diffstat (limited to 'Include/internal/pycore_dtoa.h')
-rw-r--r-- | Include/internal/pycore_dtoa.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Include/internal/pycore_dtoa.h b/Include/internal/pycore_dtoa.h index 3faf8cf..c77cf6e 100644 --- a/Include/internal/pycore_dtoa.h +++ b/Include/internal/pycore_dtoa.h @@ -1,4 +1,3 @@ -#ifndef PY_NO_SHORT_FLOAT_REPR #ifdef __cplusplus extern "C" { #endif @@ -7,6 +6,11 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif +#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR + + +#if _PY_SHORT_FLOAT_REPR == 1 + /* These functions are used by modules compiled as C extension like math: they must be exported. */ @@ -17,7 +21,8 @@ PyAPI_FUNC(void) _Py_dg_freedtoa(char *s); PyAPI_FUNC(double) _Py_dg_stdnan(int sign); PyAPI_FUNC(double) _Py_dg_infinity(int sign); +#endif // _PY_SHORT_FLOAT_REPR == 1 + #ifdef __cplusplus } #endif -#endif /* !PY_NO_SHORT_FLOAT_REPR */ |