Browse Source

python: MSVC doesn't like pure virtual methods in local classes.

appveyor-coverage
Cameron Egbert 7 years ago committed by Vladimír Vondruš
parent
commit
14fa2247e9
  1. 9
      src/python/magnum/platform/glfw.cpp
  2. 9
      src/python/magnum/platform/sdl2.cpp

9
src/python/magnum/platform/glfw.cpp

@ -41,7 +41,16 @@ void glfw(py::module& m) {
struct PublicizedApplication: Platform::Application {
explicit PublicizedApplication(const Configuration& configuration, const GLConfiguration& glConfiguration): Platform::Application{Arguments{argc, nullptr}, configuration, glConfiguration} {}
/* MSVC dies with "error C3640: a referenced or virtual member function
of a local class must be defined" if this is just `= 0` here. Since
we're overriding this method below anyway, it doesn't have to be
pure virtual. */
#ifdef _MSC_VER
void drawEvent() override {}
#else
void drawEvent() override = 0;
#endif
void mousePressEvent(MouseEvent&) override {}
void mouseReleaseEvent(MouseEvent&) override {}
void mouseMoveEvent(MouseMoveEvent&) override {}

9
src/python/magnum/platform/sdl2.cpp

@ -41,7 +41,16 @@ void sdl2(py::module& m) {
struct PublicizedApplication: Platform::Application {
explicit PublicizedApplication(const Configuration& configuration, const GLConfiguration& glConfiguration): Platform::Application{Arguments{argc, nullptr}, configuration, glConfiguration} {}
/* MSVC dies with "error C3640: a referenced or virtual member function
of a local class must be defined" if this is just `= 0` here. Since
we're overriding this method below anyway, it doesn't have to be
pure virtual. */
#ifdef _MSC_VER
void drawEvent() override {}
#else
void drawEvent() override = 0;
#endif
void mousePressEvent(MouseEvent&) override {}
void mouseReleaseEvent(MouseEvent&) override {}
void mouseMoveEvent(MouseMoveEvent&) override {}

Loading…
Cancel
Save