1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Only suggest final when using non-LTO builds

In LTO builds GCC issues the suggestion-warning from linking stage,
when pragmas are already gone and do nothing.
This commit is contained in:
Michał Janiszewski
2020-04-19 22:34:03 +02:00
parent 4f85810c14
commit 5f97637d5e
9 changed files with 40 additions and 18 deletions

View File

@@ -18,7 +18,7 @@
namespace OpenRCT2::Audio
{
class AudioContext : public IAudioContext
class AudioContext final : public IAudioContext
{
private:
IAudioMixer* _audioMixer = nullptr;

View File

@@ -172,7 +172,7 @@ public:
}
};
class OpenGLDrawingEngine : public IDrawingEngine
class OpenGLDrawingEngine final : public IDrawingEngine
{
private:
std::shared_ptr<IUiContext> const _uiContext;

View File

@@ -79,7 +79,7 @@ using namespace OpenRCT2::Ui;
namespace OpenRCT2
{
class Context : public IContext
class Context final : public IContext
{
private:
// Dependencies

View File

@@ -109,7 +109,7 @@ struct GameStateSnapshot_t
}
};
struct GameStateSnapshots : public IGameStateSnapshots
struct GameStateSnapshots final : public IGameStateSnapshots
{
virtual void Reset() override final
{

View File

@@ -297,7 +297,7 @@ namespace GameActions
return #cls; \
} \
}; \
struct cls : public GameActionBase<id, res>
struct cls final : public GameActionBase<id, res>
// clang-format on
} // namespace GameActions

View File

@@ -74,7 +74,7 @@ public:
_origin.direction &= 3;
}
uint16_t GetActionFlags() const override
uint16_t GetActionFlags() const override final
{
return GameAction::GetActionFlags();
}

View File

@@ -24,6 +24,12 @@ enum
STREAM_SEEK_END
};
#ifdef __WARN_SUGGEST_FINAL_METHODS__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsuggest-final-methods"
# pragma GCC diagnostic ignored "-Wsuggest-final-types"
#endif
/**
* Represents a stream that can be read or written to. Implemented by types such as FileStream, NetworkStream or MemoryStream.
*/
@@ -199,6 +205,10 @@ interface IStream
void WriteString(const std::string& string);
};
#ifdef __WARN_SUGGEST_FINAL_METHODS__
# pragma GCC diagnostic pop
#endif
class IOException : public std::runtime_error
{
public:

View File

@@ -85,7 +85,16 @@ namespace OpenRCT2
public:
explicit X8DrawingEngine(const std::shared_ptr<Ui::IUiContext>& uiContext);
#ifdef __WARN_SUGGEST_FINAL_METHODS__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsuggest-final-methods"
# pragma GCC diagnostic ignored "-Wsuggest-final-types"
#endif
~X8DrawingEngine() override;
#ifdef __WARN_SUGGEST_FINAL_METHODS__
# pragma GCC diagnostic pop
#endif
void Initialise() override;
void Resize(uint32_t width, uint32_t height) override;