From a3351efd49baf01e90a9ee68900ed5104ed0807f Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 27 Oct 2019 17:19:35 +0000 Subject: [PATCH] Fix the build for GCC --- src/openrct2/ParkFile.cpp | 5 ++++- src/openrct2/core/OrcaStream.hpp | 12 ++++++++++-- src/openrct2/rct2/S6Exporter.cpp | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/openrct2/ParkFile.cpp b/src/openrct2/ParkFile.cpp index cd5d636812..66861109c8 100644 --- a/src/openrct2/ParkFile.cpp +++ b/src/openrct2/ParkFile.cpp @@ -866,7 +866,10 @@ int32_t scenario_save(const utf8* path, int32_t flags) class ParkFileImporter : public IParkImporter { private: - [[maybe_unused]] const IObjectRepository& _objectRepository; +#ifdef __clang__ + [[maybe_unused]] +#endif + const IObjectRepository& _objectRepository; std::unique_ptr _parkFile; public: diff --git a/src/openrct2/core/OrcaStream.hpp b/src/openrct2/core/OrcaStream.hpp index 3ccd47fd53..c6032f1dc8 100644 --- a/src/openrct2/core/OrcaStream.hpp +++ b/src/openrct2/core/OrcaStream.hpp @@ -253,9 +253,14 @@ namespace OpenRCT2 return v; } +#if defined(_MSC_VER) || defined(__clang__) template<> void ReadWrite(std::string_view& v) = delete; +#endif - template<> void ReadWrite(std::string& v) +#if defined(_MSC_VER) || defined(__clang__) + template<> +#endif + void ReadWrite(std::string& v) { if (_mode == Mode::READING) { @@ -280,7 +285,10 @@ namespace OpenRCT2 } } - template<> void Write(const std::string_view& v) +#if defined(_MSC_VER) || defined(__clang__) + template<> +#endif + void Write(const std::string_view& v) { if (_mode == Mode::READING) { diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index dcb8987e9b..7359bad4c8 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1815,7 +1815,7 @@ enum : uint32_t * rct2: 0x006754F5 * @param flags bit 0: pack objects, 1: save as scenario */ -int32_t scenario_save_old(const utf8* path, int32_t flags) +[[maybe_unused]] static int32_t scenario_save_old(const utf8* path, int32_t flags) { if (flags & S6_SAVE_FLAG_SCENARIO) {