From bd3d1b963ca41753636a58ad3faa71fe7dba7e4e Mon Sep 17 00:00:00 2001 From: Cameron Egbert Date: Tue, 20 Aug 2019 15:42:51 -0700 Subject: [PATCH] Changes to enable Windows build of habitat-sim --- src/Magnum/SceneGraph/Python.h | 16 ++++++++-------- src/python/magnum/magnum.cpp | 2 ++ src/python/magnum/platform/glfw.cpp | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Magnum/SceneGraph/Python.h b/src/Magnum/SceneGraph/Python.h index e5cdcbd..7fb111a 100644 --- a/src/Magnum/SceneGraph/Python.h +++ b/src/Magnum/SceneGraph/Python.h @@ -62,22 +62,22 @@ template struct PyFeatureHolder: std::unique_ptr { /* Hey this needs docs. */ -template class PyObject: public Object { +template class PyObject: public Obj { public: - template explicit PyObject(Args&&... args): Object{std::forward(args)...} {} + template explicit PyObject(Args&&... args): Obj{std::forward(args)...} {} - PyObject(const PyObject&) = delete; - PyObject(PyObject&&) = delete; + PyObject(const PyObject&) = delete; + PyObject(PyObject&&) = delete; - PyObject& operator=(const PyObject&) = delete; - PyObject& operator=(PyObject&&) = delete; + PyObject& operator=(const PyObject&) = delete; + PyObject& operator=(PyObject&&) = delete; private: void doErase() override { /* When deleting a parent, disconnect this from the parent instead of deleting it. Deletion is then handled by Python itself. */ - CORRADE_INTERNAL_ASSERT(Object::parent()); - Object::setParent(nullptr); + CORRADE_INTERNAL_ASSERT(Obj::parent()); + Obj::setParent(nullptr); pybind11::cast(this).dec_ref(); } }; diff --git a/src/python/magnum/magnum.cpp b/src/python/magnum/magnum.cpp index 69d684f..0c44c66 100644 --- a/src/python/magnum/magnum.cpp +++ b/src/python/magnum/magnum.cpp @@ -216,7 +216,9 @@ void magnum(py::module& m) { /* TODO: remove declaration when https://github.com/pybind/pybind11/pull/1863 is released */ +#ifndef CORRADE_TARGET_WINDOWS extern "C" PyObject* PyInit__magnum(); +#endif PYBIND11_MODULE(_magnum, m) { /* We need ArrayView for images */ py::module::import("corrade.containers"); diff --git a/src/python/magnum/platform/glfw.cpp b/src/python/magnum/platform/glfw.cpp index 2003f74..cac410d 100644 --- a/src/python/magnum/platform/glfw.cpp +++ b/src/python/magnum/platform/glfw.cpp @@ -41,7 +41,7 @@ void glfw(py::module& m) { struct PublicizedApplication: Platform::Application { explicit PublicizedApplication(const Configuration& configuration, const GLConfiguration& glConfiguration): Platform::Application{Arguments{argc, nullptr}, configuration, glConfiguration} {} - void drawEvent() override = 0; + void drawEvent() override {} void mousePressEvent(MouseEvent&) override {} void mouseReleaseEvent(MouseEvent&) override {} void mouseMoveEvent(MouseMoveEvent&) override {}