compilation fixes

This commit is contained in:
Wenzel Jakob 2016-04-25 04:00:47 +02:00
parent 39e97e6a49
commit 084ca0e553
2 changed files with 2 additions and 6 deletions

View File

@ -128,10 +128,6 @@
} \
PyObject *pybind11_init()
extern "C" {
extern PyThreadState *_PyThreadState_Current;
};
NAMESPACE_BEGIN(pybind11)
typedef Py_ssize_t ssize_t;

View File

@ -1070,7 +1070,7 @@ public:
tstate->gilstate_counter = 0;
PyThread_set_key_value(internals.tstate, tstate);
} else {
release = _PyThreadState_Current != tstate;
release = PyThreadState_GET() != tstate;
}
if (release) {
@ -1091,7 +1091,7 @@ public:
void dec_ref() {
--tstate->gilstate_counter;
#if !defined(NDEBUG)
if (_PyThreadState_Current != tstate)
if (PyThreadState_GET() != tstate)
pybind11_fail("scoped_acquire::dec_ref(): thread state must be current!");
if (tstate->gilstate_counter < 0)
pybind11_fail("scoped_acquire::dec_ref(): reference count underflow!");