]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-119447: Fix build with _PY_SHORT_FLOAT_REPR == 0 (#121178) (#121180)
authorVictor Stinner <vstinner@python.org>
Sun, 30 Jun 2024 10:02:08 +0000 (12:02 +0200)
committerGitHub <noreply@github.com>
Sun, 30 Jun 2024 10:02:08 +0000 (10:02 +0000)
gh-119447: Fix build with _PY_SHORT_FLOAT_REPR == 0 (#121178)

(cherry picked from commit c3677befbecbd7fa94cde8c1fecaa4cc18e6aa2b)

Co-authored-by: Yureka <yuka@yuka.dev>
Include/internal/pycore_dtoa.h

index 4d9681d59a64f7bbc195f8ef703bcd1331aea7b8..899d413b05e865d9d08da888213f3da2aff0eb7b 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
@@ -65,8 +63,6 @@ PyAPI_FUNC(char *) _Py_dg_dtoa(double d, int mode, int ndigits,
                         int *decpt, int *sign, char **rve);
 PyAPI_FUNC(void) _Py_dg_freedtoa(char *s);
 
-#endif // _PY_SHORT_FLOAT_REPR == 1
-
 #ifdef __cplusplus
 }
 #endif