]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-124956: Use `#undef` for temp macros in `_csv.c` (#124957)
authorsobolevn <mail@sobolevn.me>
Mon, 7 Oct 2024 17:35:56 +0000 (20:35 +0300)
committerGitHub <noreply@github.com>
Mon, 7 Oct 2024 17:35:56 +0000 (23:05 +0530)
Modules/_csv.c

index a623ea449da7797ee347c484e55a52ee1540f460..913560ce4a0ee309b8084a6a64158636653c38cc 100644 (file)
@@ -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)
 {