diff --git a/src/python/magnum/gl.cpp b/src/python/magnum/gl.cpp index a9e6ae0..f5283c3 100644 --- a/src/python/magnum/gl.cpp +++ b/src/python/magnum/gl.cpp @@ -375,10 +375,16 @@ void gl(py::module_& m) { }, "Whether there is any current context") .def_property_readonly_static("current", std::getenv("MCSS_GENERATING_OUTPUT") ? - [](const py::object&) { + /* Without the `+` converting the lambda to a func pointer, + MSVC dies with "error C2446: ':': no conversion from + 'magnum::gl::' to + 'magnum::gl::'". + All versions including 2022 are affected, works only + with the /permissive- flag. LOL. */ + +[](const py::object&) { return ContextHolder{nullptr}; - } : - [](const py::object&) { + } : + +[](const py::object&) { if(!GL::Context::hasCurrent()) { PyErr_SetString(PyExc_RuntimeError, "no current context"); throw py::error_already_set{};