Skip to content

Commit 18463dd

Browse files
committed
Fix static linking extensions
1 parent 9089a26 commit 18463dd

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

‎Include/internal/pystate.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ extern "C" {
77
#include "pystate.h"
88
#include "pyatomic.h"
99
#include "pythread.h"
10+
#include "pyerrors.h"
11+
#include "pylifecycle.h"
1012

1113
#include "internal/mem.h"
1214
#include "internal/ceval.h"

‎Include/pystate.h‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,24 @@ PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void);
327327
PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *);
328328

329329

330+
/* Routines for advanced debuggers, requested by David Beazley.
331+
Don't use unless you know what you are doing! */
332+
#ifndef Py_LIMITED_API
333+
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void);
334+
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
335+
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
336+
PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
337+
PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
338+
339+
typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_);
340+
#endif
341+
330342
/* Variable and macro for in-line access to current thread state */
331343

332344
/* Assuming the current thread holds the GIL, this is the
333345
PyThreadState for the current thread. */
334346
#ifdef Py_BUILD_CORE
347+
# include "internal/pystate.h"
335348
# define _PyThreadState_Current _PyRuntime.gilstate.tstate_current
336349
# define PyThreadState_GET() \
337350
((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current))
@@ -408,18 +421,6 @@ PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void);
408421
PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void);
409422
#endif
410423

411-
/* Routines for advanced debuggers, requested by David Beazley.
412-
Don't use unless you know what you are doing! */
413-
#ifndef Py_LIMITED_API
414-
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void);
415-
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
416-
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
417-
PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
418-
PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
419-
420-
typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_);
421-
#endif
422-
423424
#ifdef __cplusplus
424425
}
425426
#endif

0 commit comments

Comments
 (0)