about summary refs log tree commit diff
path: root/pkgs/development/interpreters/python/cpython/3.12/0001-Fix-build-with-_PY_SHORT_FLOAT_REPR-0.patch
blob: a978413a676a6ef74bb0b81fb858663414a14cb4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 04bfb877c8ccbd431dcae429abb487c1e3390801 Mon Sep 17 00:00:00 2001
From: Yureka <yuka@yuka.dev>
Date: Sun, 30 Jun 2024 09:37:49 +0200
Subject: [PATCH] Fix build with _PY_SHORT_FLOAT_REPR == 0

---
 Include/internal/pycore_dtoa.h | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/Include/internal/pycore_dtoa.h b/Include/internal/pycore_dtoa.h
index 4d9681d59a..899d413b05 100644
--- a/Include/internal/pycore_dtoa.h
+++ b/Include/internal/pycore_dtoa.h
@@ -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
-- 
2.45.1