Skip to content

Commit 35f794e

Browse files
authored
Fix extension build failure with C23 (#121)
`thread_local` is a new keyword in C23. Avoid colliding with it.
1 parent 013f276 commit 35f794e

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
8.1 (unreleased)
66
----------------
77

8-
- Nothing changed yet.
8+
- Fix ``zope.security._zope_security_checker`` extension build failure with
9+
C23.
910

1011

1112
8.0 (2025-09-15)

src/zope/security/_zope_security_checker.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <Python.h>
1515

1616
static PyObject *_checkers, *_defaultChecker, *_available_by_default, *NoProxy;
17-
static PyObject *Proxy, *thread_local, *CheckerPublic;
17+
static PyObject *Proxy, *_thread_local, *CheckerPublic;
1818
static PyObject *ForbiddenAttribute, *Unauthorized;
1919

2020

@@ -105,7 +105,7 @@ checkPermission(PyObject *permission, PyObject *object, PyObject *name)
105105

106106
/* if thread_local.interaction.checkPermission(permission, object): */
107107
/* return */
108-
interaction = PyObject_GetAttr(thread_local, str_interaction);
108+
interaction = PyObject_GetAttr(_thread_local, str_interaction);
109109
if (interaction == NULL)
110110
return -1;
111111
r = PyObject_CallMethodObjArgs(interaction, str_checkPermission,
@@ -620,8 +620,8 @@ if((str_##S = INTERN(#S)) == NULL) return MOD_ERROR_VAL
620620
{
621621
return MOD_ERROR_VAL;
622622
}
623-
thread_local = PyObject_GetAttrString(m, "thread_local");
624-
if (thread_local == NULL)
623+
_thread_local = PyObject_GetAttrString(m, "thread_local");
624+
if (_thread_local == NULL)
625625
{
626626
return MOD_ERROR_VAL;
627627
}

0 commit comments

Comments
 (0)