Commit 084ca0e5 by Wenzel Jakob

compilation fixes

parent 39e97e6a
...@@ -128,10 +128,6 @@ ...@@ -128,10 +128,6 @@
} \ } \
PyObject *pybind11_init() PyObject *pybind11_init()
extern "C" {
extern PyThreadState *_PyThreadState_Current;
};
NAMESPACE_BEGIN(pybind11) NAMESPACE_BEGIN(pybind11)
typedef Py_ssize_t ssize_t; typedef Py_ssize_t ssize_t;
......
...@@ -1070,7 +1070,7 @@ public: ...@@ -1070,7 +1070,7 @@ public:
tstate->gilstate_counter = 0; tstate->gilstate_counter = 0;
PyThread_set_key_value(internals.tstate, tstate); PyThread_set_key_value(internals.tstate, tstate);
} else { } else {
release = _PyThreadState_Current != tstate; release = PyThreadState_GET() != tstate;
} }
if (release) { if (release) {
...@@ -1091,7 +1091,7 @@ public: ...@@ -1091,7 +1091,7 @@ public:
void dec_ref() { void dec_ref() {
--tstate->gilstate_counter; --tstate->gilstate_counter;
#if !defined(NDEBUG) #if !defined(NDEBUG)
if (_PyThreadState_Current != tstate) if (PyThreadState_GET() != tstate)
pybind11_fail("scoped_acquire::dec_ref(): thread state must be current!"); pybind11_fail("scoped_acquire::dec_ref(): thread state must be current!");
if (tstate->gilstate_counter < 0) if (tstate->gilstate_counter < 0)
pybind11_fail("scoped_acquire::dec_ref(): reference count underflow!"); pybind11_fail("scoped_acquire::dec_ref(): reference count underflow!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment