PYBIND11_TLS_REPLACE_VALUE should use macro argument value in Python 3.7+ (#1683)

This commit is contained in:
Jeffrey Quesnelle 2019-06-10 16:13:35 -04:00 committed by Wenzel Jakob
parent 2b045757b5
commit f93cd0aa72

View File

@ -23,7 +23,7 @@ inline PyObject *make_object_base_type(PyTypeObject *metaclass);
#if PY_VERSION_HEX >= 0x03070000
# define PYBIND11_TLS_KEY_INIT(var) Py_tss_t *var = nullptr
# define PYBIND11_TLS_GET_VALUE(key) PyThread_tss_get((key))
# define PYBIND11_TLS_REPLACE_VALUE(key, value) PyThread_tss_set((key), (tstate))
# define PYBIND11_TLS_REPLACE_VALUE(key, value) PyThread_tss_set((key), (value))
# define PYBIND11_TLS_DELETE_VALUE(key) PyThread_tss_set((key), nullptr)
#else
// Usually an int but a long on Cygwin64 with Python 3.x