mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
compilation fixes
This commit is contained in:
parent
39e97e6a49
commit
084ca0e553
@ -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:
|
|||||||
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:
|
|||||||
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!");
|
||||||
|
Loading…
Reference in New Issue
Block a user