Skip to content
Prev Previous commit
Next Next commit
SIZEOF_UINTPTR_T isn't defined on Windows
  • Loading branch information
brandtbucher committed Mar 3, 2022
commit 452c78ccd2a41d76039eadf51e1f164b0e14ed62
12 changes: 6 additions & 6 deletions Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -509,25 +509,25 @@ static inline void
write_obj(uint16_t *p, PyObject *obj)
{
uintptr_t val = (uintptr_t)obj;
#if SIZEOF_UINTPTR_T == 8
#if SIZEOF_VOID_P == 8
write_u64(p, val);
#elif SIZEOF_UINTPTR_T == 4
#elif SIZEOF_VOID_P == 4
write_u32(p, val);
#else
#error "sizeof(uintptr_t) must be 4 or 8"
#error "SIZEOF_VOID_P must be 4 or 8"
#endif
}

static inline PyObject *
read_obj(uint16_t *p)
{
uintptr_t val;
#if SIZEOF_UINTPTR_T == 8
#if SIZEOF_VOID_P == 8
val = read_u64(p);
#elif SIZEOF_UINTPTR_T == 4
#elif SIZEOF_VOID_P == 4
val = read_u32(p);
#else
#error "sizeof(uintptr_t) must be 4 or 8"
#error "SIZEOF_VOID_P must be 4 or 8"
#endif
return (PyObject *)val;
}
Expand Down