diff --git a/Include/internal/pycore_pythread.h b/Include/internal/pycore_pythread.h index 8457b07340f8dd..8d439d19830398 100644 --- a/Include/internal/pycore_pythread.h +++ b/Include/internal/pycore_pythread.h @@ -1,14 +1,15 @@ #ifndef Py_INTERNAL_PYTHREAD_H #define Py_INTERNAL_PYTHREAD_H -#ifdef __cplusplus -extern "C" { -#endif #ifndef Py_BUILD_CORE # error "this header requires Py_BUILD_CORE define" #endif #include "dynamic_annotations.h" // _Py_ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX + +#ifdef __cplusplus +extern "C" { +#endif #include "pycore_llist.h" // struct llist_node // Get _POSIX_THREADS and _POSIX_SEMAPHORES macros if available diff --git a/Misc/NEWS.d/next/C_API/2025-09-10-17-49-54.gh-issue-138762.1rG6GQ.rst b/Misc/NEWS.d/next/C_API/2025-09-10-17-49-54.gh-issue-138762.1rG6GQ.rst new file mode 100644 index 00000000000000..9fa191a83638df --- /dev/null +++ b/Misc/NEWS.d/next/C_API/2025-09-10-17-49-54.gh-issue-138762.1rG6GQ.rst @@ -0,0 +1 @@ +Fix linking of the free-threaded build with C++ compiler.