Skip to content

[3.13] gh-128083: Fix macro redefinition warning in clinic. (GH-127950) #128102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions Lib/test/clinic.test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5011,6 +5011,75 @@ static int
Test_property_set_impl(TestObj *self, PyObject *value)
/*[clinic end generated code: output=e4342fe9bb1d7817 input=3bc3f46a23c83a88]*/

/*[clinic input]
@setter
Test.setter_first_with_docstr
[clinic start generated code]*/

#if !defined(Test_setter_first_with_docstr_DOCSTR)
# define Test_setter_first_with_docstr_DOCSTR NULL
#endif
#if defined(TEST_SETTER_FIRST_WITH_DOCSTR_GETSETDEF)
# undef TEST_SETTER_FIRST_WITH_DOCSTR_GETSETDEF
# define TEST_SETTER_FIRST_WITH_DOCSTR_GETSETDEF {"setter_first_with_docstr", (getter)Test_setter_first_with_docstr_get, (setter)Test_setter_first_with_docstr_set, Test_setter_first_with_docstr_DOCSTR},
#else
# define TEST_SETTER_FIRST_WITH_DOCSTR_GETSETDEF {"setter_first_with_docstr", NULL, (setter)Test_setter_first_with_docstr_set, NULL},
#endif

static int
Test_setter_first_with_docstr_set_impl(TestObj *self, PyObject *value);

static int
Test_setter_first_with_docstr_set(TestObj *self, PyObject *value, void *Py_UNUSED(context))
{
int return_value;

return_value = Test_setter_first_with_docstr_set_impl(self, value);

return return_value;
}

static int
Test_setter_first_with_docstr_set_impl(TestObj *self, PyObject *value)
/*[clinic end generated code: output=e4d76b558a4061db input=31a045ce11bbe961]*/

/*[clinic input]
@getter
Test.setter_first_with_docstr

my silly docstring
[clinic start generated code]*/

PyDoc_STRVAR(Test_setter_first_with_docstr__doc__,
"my silly docstring");
#if defined(Test_setter_first_with_docstr_DOCSTR)
# undef Test_setter_first_with_docstr_DOCSTR
#endif
#define Test_setter_first_with_docstr_DOCSTR Test_setter_first_with_docstr__doc__

#if !defined(Test_setter_first_with_docstr_DOCSTR)
# define Test_setter_first_with_docstr_DOCSTR NULL
#endif
#if defined(TEST_SETTER_FIRST_WITH_DOCSTR_GETSETDEF)
# undef TEST_SETTER_FIRST_WITH_DOCSTR_GETSETDEF
# define TEST_SETTER_FIRST_WITH_DOCSTR_GETSETDEF {"setter_first_with_docstr", (getter)Test_setter_first_with_docstr_get, (setter)Test_setter_first_with_docstr_set, Test_setter_first_with_docstr_DOCSTR},
#else
# define TEST_SETTER_FIRST_WITH_DOCSTR_GETSETDEF {"setter_first_with_docstr", (getter)Test_setter_first_with_docstr_get, NULL, Test_setter_first_with_docstr_DOCSTR},
#endif

static PyObject *
Test_setter_first_with_docstr_get_impl(TestObj *self);

static PyObject *
Test_setter_first_with_docstr_get(TestObj *self, void *Py_UNUSED(context))
{
return Test_setter_first_with_docstr_get_impl(self);
}

static PyObject *
Test_setter_first_with_docstr_get_impl(TestObj *self)
/*[clinic end generated code: output=749a30266f9fb443 input=10af4e43b3cb34dc]*/

/*[clinic input]
output push
output preset buffer
Expand Down
11 changes: 10 additions & 1 deletion Modules/_io/clinic/textio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 49 additions & 1 deletion Modules/clinic/_ssl.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Tools/clinic/libclinic/parse_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ def declare_parser(
GETSET_DOCSTRING_PROTOTYPE_STRVAR: Final[str] = libclinic.normalize_snippet("""
PyDoc_STRVAR({getset_basename}__doc__,
{docstring});
#if defined({getset_basename}_DOCSTR)
# undef {getset_basename}_DOCSTR
#endif
#define {getset_basename}_DOCSTR {getset_basename}__doc__
""")
IMPL_DEFINITION_PROTOTYPE: Final[str] = libclinic.normalize_snippet("""
Expand Down
Loading