Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove _Py_thread_local macro definition
  • Loading branch information
ZeroIntensity authored Oct 28, 2025
commit b2dde90f79579ac44b1fc6b2a19e01897a644f98
16 changes: 0 additions & 16 deletions Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,6 @@ _Py_ThreadCanHandleSignals(PyInterpreterState *interp)
return (_Py_IsMainThread() && _Py_IsMainInterpreter(interp));
}

/* Definition of the _Py_thread_local macro. In reality, this should really be
* in pyport.h, but some extensions define Py_BUILD_CORE after including that.
* So, instead of breaking things, we just put this here for now. */

#ifdef thread_local
# define _Py_thread_local thread_local
#elif __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__)
# define _Py_thread_local _Thread_local
#elif defined(_MSC_VER) /* AKA NT_THREADS */
# define _Py_thread_local __declspec(thread)
#elif defined(__GNUC__) /* includes clang */
# define _Py_thread_local __thread
#else
# error "no supported thread-local variable storage classifier"
#endif

Comment thread
kumaraditya303 marked this conversation as resolved.
/* Variable and static inline functions for in-line access to current thread
and interpreter state */

Expand Down