Fix C++17 error: standard attributes in middle of decl-specifiers (CYTHON_UNUSED)

This is only relevant on Python 3.13+

Fixes (part of) https://bugzilla.redhat.com/2247486
This commit is contained in:
Miro Hrončok 2023-11-06 11:37:34 +01:00
parent 5907573e25
commit 704bbe1117
2 changed files with 39 additions and 0 deletions

35
5791.patch Normal file
View File

@ -0,0 +1,35 @@
From add379d9df149149e3718bd8f71945b7d02fcf4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Wed, 1 Nov 2023 21:32:40 +0100
Subject: [PATCH] Fix C++17 error: standard attributes in middle of
decl-specifiers (CYTHON_UNUSED)
This is only relevant on Python 3.13+
Fixes https://github.com/cython/cython/issues/5790
---
Cython/Utility/FunctionArguments.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Cython/Utility/FunctionArguments.c b/Cython/Utility/FunctionArguments.c
index 5050a094a88..0dc89c638ab 100644
--- a/Cython/Utility/FunctionArguments.c
+++ b/Cython/Utility/FunctionArguments.c
@@ -505,7 +505,7 @@ static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
#define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
- static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);/*proto*/
+ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);/*proto*/
#else
#define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
#endif
@@ -563,7 +563,7 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
-static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
+CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
PyObject *dict;

View File

@ -13,6 +13,10 @@ License: Apache-2.0
URL: http://www.cython.org
Source: https://github.com/cython/cython/archive/%{version}/Cython-%{version}.tar.gz
# Fix C++17 error: standard attributes in middle of decl-specifiers (CYTHON_UNUSED)
# This is only relevant on Python 3.13+
Patch: https://github.com/cython/cython/pull/5791.patch
BuildRequires: python3-devel
%if %{with tests}