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:
@@ -18,7 +18,7 @@
|
||||
|
||||
namespace OpenRCT2::Audio
|
||||
{
|
||||
class AudioContext : public IAudioContext
|
||||
class AudioContext final : public IAudioContext
|
||||
{
|
||||
private:
|
||||
IAudioMixer* _audioMixer = nullptr;
|
||||
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class OpenGLDrawingEngine : public IDrawingEngine
|
||||
class OpenGLDrawingEngine final : public IDrawingEngine
|
||||
{
|
||||
private:
|
||||
std::shared_ptr<IUiContext> const _uiContext;
|
||||
|
||||
@@ -79,7 +79,7 @@ using namespace OpenRCT2::Ui;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
class Context : public IContext
|
||||
class Context final : public IContext
|
||||
{
|
||||
private:
|
||||
// Dependencies
|
||||
|
||||
@@ -109,7 +109,7 @@ struct GameStateSnapshot_t
|
||||
}
|
||||
};
|
||||
|
||||
struct GameStateSnapshots : public IGameStateSnapshots
|
||||
struct GameStateSnapshots final : public IGameStateSnapshots
|
||||
{
|
||||
virtual void Reset() override final
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
_origin.direction &= 3;
|
||||
}
|
||||
|
||||
uint16_t GetActionFlags() const override
|
||||
uint16_t GetActionFlags() const override final
|
||||
{
|
||||
return GameAction::GetActionFlags();
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user