summaryrefslogtreecommitdiffstats
path: root/Modules/_csv.c
diff options
context:
space:
mode:
authorsobolevn <mail@sobolevn.me>2024-10-07 17:35:56 (GMT)
committerGitHub <noreply@github.com>2024-10-07 17:35:56 (GMT)
commit51d426dc033ef9208c0244a569f3e816e4c328c9 (patch)
tree52618eed9a699aac592d347786867f4356ef65df /Modules/_csv.c
parentd1453f60c2d289d74d535874e07741745b023c90 (diff)
downloadcpython-51d426dc033ef9208c0244a569f3e816e4c328c9.zip
cpython-51d426dc033ef9208c0244a569f3e816e4c328c9.tar.gz
cpython-51d426dc033ef9208c0244a569f3e816e4c328c9.tar.bz2
gh-124956: Use `#undef` for temp macros in `_csv.c` (#124957)
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r--Modules/_csv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c
index a623ea4..913560c 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -367,6 +367,8 @@ static struct PyMemberDef Dialect_memberlist[] = {
{ NULL }
};
+#undef D_OFF
+
static PyGetSetDef Dialect_getsetlist[] = {
{ "delimiter", (getter)Dialect_get_delimiter},
{ "escapechar", (getter)Dialect_get_escapechar},
@@ -502,6 +504,7 @@ dialect_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
DIALECT_GETATTR(skipinitialspace, "skipinitialspace");
DIALECT_GETATTR(strict, "strict");
}
+#undef DIALECT_GETATTR
/* check types and convert to C values */
#define DIASET(meth, name, target, src, dflt) \
@@ -515,6 +518,7 @@ dialect_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
DIASET(_set_int, "quoting", &self->quoting, quoting, QUOTE_MINIMAL);
DIASET(_set_bool, "skipinitialspace", &self->skipinitialspace, skipinitialspace, false);
DIASET(_set_bool, "strict", &self->strict, strict, false);
+#undef DIASET
/* validate options */
if (dialect_check_quoting(self->quoting))
@@ -1026,6 +1030,8 @@ static struct PyMemberDef Reader_memberlist[] = {
{ NULL }
};
+#undef R_OFF
+
static PyType_Slot Reader_Type_slots[] = {
{Py_tp_doc, (char*)Reader_Type_doc},
@@ -1441,6 +1447,8 @@ static struct PyMemberDef Writer_memberlist[] = {
{ NULL }
};
+#undef W_OFF
+
static int
Writer_traverse(WriterObj *self, visitproc visit, void *arg)
{