Browse Source

GCC 4.5 compatibility: better workaround for defaulted destructors.

Previous solution was breaking "constexprness" on GCC > 4.5, thus we
need to do it two different ways.
Vladimír Vondruš 13 years ago
parent
commit
f4d62da49d
  1. 6
      src/Platform/AbstractXApplication.h
  2. 6
      src/Platform/GlutApplication.h
  3. 8
      src/Platform/NaClApplication.h
  4. 6
      src/Platform/Sdl2Application.h

6
src/Platform/AbstractXApplication.h

@ -289,7 +289,11 @@ class AbstractXApplication::InputEvent {
protected:
constexpr InputEvent(Modifiers modifiers): _modifiers(modifiers), _accepted(false) {}
#ifndef CORRADE_GCC45_COMPATIBILITY
~InputEvent() = default;
#else
~InputEvent();
#endif
#endif
private:
@ -297,7 +301,9 @@ class AbstractXApplication::InputEvent {
bool _accepted;
};
#ifdef CORRADE_GCC45_COMPATIBILITY
AbstractXApplication::InputEvent::~InputEvent() = default;
#endif
CORRADE_ENUMSET_OPERATORS(AbstractXApplication::InputEvent::Modifiers)

6
src/Platform/GlutApplication.h

@ -366,13 +366,19 @@ class GlutApplication::InputEvent {
protected:
constexpr InputEvent(): _accepted(false) {}
#ifndef CORRADE_GCC45_COMPATIBILITY
~InputEvent() = default;
#else
~InputEvent();
#endif
private:
bool _accepted;
};
#ifdef CORRADE_GCC45_COMPATIBILITY
GlutApplication::InputEvent::~InputEvent() = default;
#endif
/**
@brief Key event

8
src/Platform/NaClApplication.h

@ -410,7 +410,11 @@ class NaClApplication::InputEvent {
protected:
constexpr InputEvent(Modifiers modifiers): _accepted(false), _modifiers(modifiers) {}
#ifndef CORRADE_GCC45_COMPATIBILITY
~InputEvent() = default;
#else
~InputEvent();
#endif
#endif
private:
@ -418,6 +422,10 @@ class NaClApplication::InputEvent {
const Modifiers _modifiers;
};
#ifdef CORRADE_GCC45_COMPATIBILITY
NaClApplication::InputEvent::~InputEvent() = default;
#endif
/**
@brief Key event

6
src/Platform/Sdl2Application.h

@ -349,14 +349,20 @@ class Sdl2Application::InputEvent {
protected:
constexpr explicit InputEvent(): _accepted(false) {}
#ifndef CORRADE_GCC45_COMPATIBILITY
~InputEvent() = default;
#else
~InputEvent();
#endif
#endif
private:
bool _accepted;
};
#ifdef CORRADE_GCC45_COMPATIBILITY
Sdl2Application::InputEvent::~InputEvent() = default;
#endif
/**
@brief Key event

Loading…
Cancel
Save