]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-119447: Fix build with _PY_SHORT_FLOAT_REPR == 0 (#121178)
authorYureka <yuka@yuka.dev>
Sun, 30 Jun 2024 09:40:40 +0000 (11:40 +0200)
committerGitHub <noreply@github.com>
Sun, 30 Jun 2024 09:40:40 +0000 (11:40 +0200)
Include/internal/pycore_dtoa.h

index c5cfdf4ce8f823fc4f2da4c119ed9addb4abe5c5..e4222c5267d6bec25a2e0c954f731963f2b9ac1b 100644 (file)
@@ -11,8 +11,6 @@ extern "C" {
 #include "pycore_pymath.h"        // _PY_SHORT_FLOAT_REPR
 
 
-#if _PY_SHORT_FLOAT_REPR == 1
-
 typedef uint32_t ULong;
 
 struct
@@ -22,15 +20,15 @@ Bigint {
     ULong x[1];
 };
 
-#ifdef Py_USING_MEMORY_DEBUGGER
+#if defined(Py_USING_MEMORY_DEBUGGER) || _PY_SHORT_FLOAT_REPR == 0
 
 struct _dtoa_state {
     int _not_used;
 };
-#define _dtoa_interp_state_INIT(INTERP) \
+#define _dtoa_state_INIT(INTERP) \
     {0}
 
-#else  // !Py_USING_MEMORY_DEBUGGER
+#else  // !Py_USING_MEMORY_DEBUGGER && _PY_SHORT_FLOAT_REPR != 0
 
 /* The size of the Bigint freelist */
 #define Bigint_Kmax 7
@@ -66,8 +64,6 @@ extern char* _Py_dg_dtoa(double d, int mode, int ndigits,
                          int *decpt, int *sign, char **rve);
 extern void _Py_dg_freedtoa(char *s);
 
-#endif // _PY_SHORT_FLOAT_REPR == 1
-
 
 extern PyStatus _PyDtoa_Init(PyInterpreterState *interp);
 extern void _PyDtoa_Fini(PyInterpreterState *interp);