summaryrefslogtreecommitdiffstats
path: root/Python/dtoa.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-02-23 17:16:23 (GMT)
committerGitHub <noreply@github.com>2022-02-23 17:16:23 (GMT)
commit9bbdde218005f552304d9954bb97e3f9185edded (patch)
tree2085d4399dfdcb03bbf9af4c7e5cf92bbdb55f43 /Python/dtoa.c
parent375a56bd4015596c0cf44129c8842a1fe7199785 (diff)
downloadcpython-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 'Python/dtoa.c')
-rw-r--r--Python/dtoa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/dtoa.c b/Python/dtoa.c
index 6c44f68..733e70b 100644
--- a/Python/dtoa.c
+++ b/Python/dtoa.c
@@ -118,12 +118,12 @@
/* Linking of Python's #defines to Gay's #defines starts here. */
#include "Python.h"
-#include "pycore_dtoa.h"
+#include "pycore_dtoa.h" // _PY_SHORT_FLOAT_REPR
#include <stdlib.h> // exit()
-/* if PY_NO_SHORT_FLOAT_REPR is defined, then don't even try to compile
+/* if _PY_SHORT_FLOAT_REPR == 0, then don't even try to compile
the following code */
-#ifndef PY_NO_SHORT_FLOAT_REPR
+#if _PY_SHORT_FLOAT_REPR == 1
#include "float.h"
@@ -2857,4 +2857,4 @@ _Py_dg_dtoa(double dd, int mode, int ndigits,
}
#endif
-#endif /* PY_NO_SHORT_FLOAT_REPR */
+#endif // _PY_SHORT_FLOAT_REPR == 1