diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 166966a1c..e86a7fa2c 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -983,6 +983,7 @@ template void implicitly_convertible() ((detail::type_info *) it->second)->implicit_conversions.push_back(implicit_caster); } +#if defined(WITH_THREAD) inline void init_threading() { PyEval_InitThreads(); } class gil_scoped_acquire { @@ -998,6 +999,7 @@ public: inline gil_scoped_release() { state = PyEval_SaveThread(); } inline ~gil_scoped_release() { PyEval_RestoreThread(state); } }; +#endif inline function get_overload(const void *this_ptr, const char *name) { handle py_object = detail::get_object_handle(this_ptr);