summaryrefslogtreecommitdiffstats
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-07-25 13:28:30 (GMT)
committerGitHub <noreply@github.com>2023-07-25 13:28:30 (GMT)
commit1a3faba9f15e0c03c6cc0d225d377b8910b5379f (patch)
tree0aebe4139933835899fd5f618c023bceb9de0389 /Modules/selectmodule.c
parented082383272c2c238e364e9cc83229234aee23cc (diff)
downloadcpython-1a3faba9f15e0c03c6cc0d225d377b8910b5379f.zip
cpython-1a3faba9f15e0c03c6cc0d225d377b8910b5379f.tar.gz
cpython-1a3faba9f15e0c03c6cc0d225d377b8910b5379f.tar.bz2
gh-106869: Use new PyMemberDef constant names (#106871)
* Remove '#include "structmember.h"'. * If needed, add <stddef.h> to get offsetof() function. * Update Parser/asdl_c.py to regenerate Python/Python-ast.c. * Replace: * T_SHORT => Py_T_SHORT * T_INT => Py_T_INT * T_LONG => Py_T_LONG * T_FLOAT => Py_T_FLOAT * T_DOUBLE => Py_T_DOUBLE * T_STRING => Py_T_STRING * T_OBJECT => _Py_T_OBJECT * T_CHAR => Py_T_CHAR * T_BYTE => Py_T_BYTE * T_UBYTE => Py_T_UBYTE * T_USHORT => Py_T_USHORT * T_UINT => Py_T_UINT * T_ULONG => Py_T_ULONG * T_STRING_INPLACE => Py_T_STRING_INPLACE * T_BOOL => Py_T_BOOL * T_OBJECT_EX => Py_T_OBJECT_EX * T_LONGLONG => Py_T_LONGLONG * T_ULONGLONG => Py_T_ULONGLONG * T_PYSSIZET => Py_T_PYSSIZET * T_NONE => _Py_T_NONE * READONLY => Py_READONLY * PY_AUDIT_READ => Py_AUDIT_READ * READ_RESTRICTED => Py_AUDIT_READ * PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED * RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r--Modules/selectmodule.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 7ab0804..94d2469 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -15,7 +15,8 @@
#include "Python.h"
#include "pycore_fileutils.h" // _Py_set_inheritable()
#include "pycore_time.h" // _PyTime_t
-#include "structmember.h" // PyMemberDef
+
+#include <stddef.h> // offsetof()
#ifdef HAVE_SYS_DEVPOLL_H
#include <sys/resource.h>
@@ -1758,18 +1759,18 @@ typedef struct {
#if (SIZEOF_UINTPTR_T != SIZEOF_VOID_P)
# error uintptr_t does not match void *!
#elif (SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG)
-# define T_UINTPTRT T_ULONGLONG
-# define T_INTPTRT T_LONGLONG
+# define T_UINTPTRT Py_T_ULONGLONG
+# define T_INTPTRT Py_T_LONGLONG
# define UINTPTRT_FMT_UNIT "K"
# define INTPTRT_FMT_UNIT "L"
#elif (SIZEOF_UINTPTR_T == SIZEOF_LONG)
-# define T_UINTPTRT T_ULONG
-# define T_INTPTRT T_LONG
+# define T_UINTPTRT Py_T_ULONG
+# define T_INTPTRT Py_T_LONG
# define UINTPTRT_FMT_UNIT "k"
# define INTPTRT_FMT_UNIT "l"
#elif (SIZEOF_UINTPTR_T == SIZEOF_INT)
-# define T_UINTPTRT T_UINT
-# define T_INTPTRT T_INT
+# define T_UINTPTRT Py_T_UINT
+# define T_INTPTRT Py_T_INT
# define UINTPTRT_FMT_UNIT "I"
# define INTPTRT_FMT_UNIT "i"
#else
@@ -1777,26 +1778,26 @@ typedef struct {
#endif
#if SIZEOF_LONG_LONG == 8
-# define T_INT64 T_LONGLONG
+# define T_INT64 Py_T_LONGLONG
# define INT64_FMT_UNIT "L"
#elif SIZEOF_LONG == 8
-# define T_INT64 T_LONG
+# define T_INT64 Py_T_LONG
# define INT64_FMT_UNIT "l"
#elif SIZEOF_INT == 8
-# define T_INT64 T_INT
+# define T_INT64 Py_T_INT
# define INT64_FMT_UNIT "i"
#else
# define INT64_FMT_UNIT "_"
#endif
#if SIZEOF_LONG_LONG == 4
-# define T_UINT32 T_ULONGLONG
+# define T_UINT32 Py_T_ULONGLONG
# define UINT32_FMT_UNIT "K"
#elif SIZEOF_LONG == 4
-# define T_UINT32 T_ULONG
+# define T_UINT32 Py_T_ULONG
# define UINT32_FMT_UNIT "k"
#elif SIZEOF_INT == 4
-# define T_UINT32 T_UINT
+# define T_UINT32 Py_T_UINT
# define UINT32_FMT_UNIT "I"
#else
# define UINT32_FMT_UNIT "_"
@@ -1813,11 +1814,11 @@ typedef struct {
# define FFLAGS_TYPE T_UINT32
# define FFLAGS_FMT_UNIT UINT32_FMT_UNIT
#else
-# define FILTER_TYPE T_SHORT
+# define FILTER_TYPE Py_T_SHORT
# define FILTER_FMT_UNIT "h"
-# define FLAGS_TYPE T_USHORT
+# define FLAGS_TYPE Py_T_USHORT
# define FLAGS_FMT_UNIT "H"
-# define FFLAGS_TYPE T_UINT
+# define FFLAGS_TYPE Py_T_UINT
# define FFLAGS_FMT_UNIT "I"
#endif
@@ -1839,7 +1840,7 @@ static struct PyMemberDef kqueue_event_members[] = {
{"ident", T_UINTPTRT, KQ_OFF(e.ident)},
{"filter", FILTER_TYPE, KQ_OFF(e.filter)},
{"flags", FLAGS_TYPE, KQ_OFF(e.flags)},
- {"fflags", T_UINT, KQ_OFF(e.fflags)},
+ {"fflags", Py_T_UINT, KQ_OFF(e.fflags)},
{"data", DATA_TYPE, KQ_OFF(e.data)},
{"udata", T_UINTPTRT, KQ_OFF(e.udata)},
{NULL} /* Sentinel */