From 275ea67e6b272234c3bccfedf0085308f8969412 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 21 Dec 1998 18:28:10 +0000 Subject: [PATCH] Add macro version of PyThreadState_GET(). This uses _PyThreadState_Current, defined in pystate.c. --- Include/pystate.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Include/pystate.h b/Include/pystate.h index 8a58a3978e7..f6a26fdb1be 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -101,6 +101,17 @@ DL_IMPORT(PyThreadState *) PyThreadState_Get Py_PROTO((void)); DL_IMPORT(PyThreadState *) PyThreadState_Swap Py_PROTO((PyThreadState *)); DL_IMPORT(PyObject *) PyThreadState_GetDict Py_PROTO((void)); + +/* Variable and macro for in-line access to current thread state */ + +DL_IMPORT(PyThreadState *) _PyThreadState_Current; + +#ifdef Py_DEBUG +#define PyThreadState_GET() PyThreadState_Get() +#else +#define PyThreadState_GET() (_PyThreadState_Current) +#endif + #ifdef __cplusplus } #endif