From f4d62da49d553211d9291fae1c9cae7be977f246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 9 Oct 2013 23:05:06 +0200 Subject: [PATCH] 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. --- src/Platform/AbstractXApplication.h | 6 ++++++ src/Platform/GlutApplication.h | 6 ++++++ src/Platform/NaClApplication.h | 8 ++++++++ src/Platform/Sdl2Application.h | 6 ++++++ 4 files changed, 26 insertions(+) diff --git a/src/Platform/AbstractXApplication.h b/src/Platform/AbstractXApplication.h index f8d410356..b773411c3 100644 --- a/src/Platform/AbstractXApplication.h +++ b/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) diff --git a/src/Platform/GlutApplication.h b/src/Platform/GlutApplication.h index 09850e399..f76f081fc 100644 --- a/src/Platform/GlutApplication.h +++ b/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 diff --git a/src/Platform/NaClApplication.h b/src/Platform/NaClApplication.h index 0cde0c3a7..38353e3be 100644 --- a/src/Platform/NaClApplication.h +++ b/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 diff --git a/src/Platform/Sdl2Application.h b/src/Platform/Sdl2Application.h index 82aeb4cf6..9fafc78f8 100644 --- a/src/Platform/Sdl2Application.h +++ b/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