Skip to content

Commit 54784f5

Browse files
Restore uint for obmalloc.
1 parent 2fcdbd2 commit 54784f5

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

Include/internal/pycore_obmalloc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11+
12+
#undef uint
13+
#define uint unsigned int /* assuming >= 16 bits */
14+
15+
1116
/* An object allocator for Python.
1217
1318
Here is an introduction to the layers of the Python memory architecture,

Modules/_ctypes/_ctypes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ bytes(cdata)
113113
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
114114
#include "structmember.h" // PyMemberDef
115115

116+
#undef uint // from pycore_obmalloc.h
117+
116118
#include <ffi.h>
117119
#ifdef MS_WIN32
118120
#include <malloc.h>

Modules/_ctypes/callbacks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# include <malloc.h>
1919
#endif
2020

21+
#undef uint // from pycore_obmalloc.h
22+
2123
#include <ffi.h>
2224
#include "ctypes.h"
2325

Modules/_ctypes/cfield.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include "pycore_bitutils.h" // _Py_bswap32()
1212
#include "pycore_call.h" // _PyObject_CallNoArgs()
1313

14+
#undef uint // from pycore_obmalloc.h
15+
1416
#include <ffi.h>
1517
#include "ctypes.h"
1618

Modules/_ctypes/stgdict.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#endif
1010

1111
#include "pycore_call.h" // _PyObject_CallNoArgs()
12+
13+
#undef uint // from pycore_obmalloc.h
14+
1215
#include <ffi.h>
1316
#ifdef MS_WIN32
1417
# include <malloc.h>

Objects/obmalloc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#include "Python.h"
2-
#include "pycore_pymem.h" // _PyTraceMalloc_Config
32
#include "pycore_code.h" // stats
43
#include "pycore_pystate.h" // _PyInterpreterState_GET
4+
5+
#include "pycore_obmalloc.h"
56
#include "pycore_pymem.h"
67
#include "pycore_pymem_allocators.h"
78

@@ -14,9 +15,6 @@ extern void _PyMem_DumpTraceback(int fd, const void *ptr);
1415

1516
/* Python's malloc wrappers (see pymem.h) */
1617

17-
#undef uint
18-
#define uint unsigned int /* assuming >= 16 bits */
19-
2018
static void _PyObject_DebugDumpAddress(const void *p);
2119
static void _PyMem_DebugCheckAddress(const char *func, char api_id, const void *p);
2220

0 commit comments

Comments
 (0)