From 3c35558f3f9735d81ee1cd1245742ab2d09cd689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 14 May 2024 00:09:00 +0200 Subject: [PATCH] Fix compilation on Arch Linux with GCC 14 (#22031) Fixes #22029 --- .../drawing/engines/opengl/OpenGLDrawingEngine.cpp | 1 + src/openrct2-ui/windows/ShortcutKeys.cpp | 1 + src/openrct2/core/Algorithm.hpp | 1 + src/openrct2/core/Imaging.cpp | 1 + src/openrct2/drawing/X8DrawingEngine.cpp | 1 + src/openrct2/entity/EntityTweener.cpp | 1 + src/openrct2/object/Object.cpp | 1 + src/openrct2/object/ObjectTypes.cpp | 2 ++ src/openrct2/paint/Paint.h | 5 ++++- src/openrct2/util/Util.cpp | 1 + 10 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index dd9b2cad1b..6fa1769581 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -22,6 +22,7 @@ # include "TransparencyDepth.h" # include +# include # include # include # include diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 084373cb06..05f34fab59 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -10,6 +10,7 @@ #include "../input/ShortcutManager.h" #include "Window.h" +#include #include #include #include diff --git a/src/openrct2/core/Algorithm.hpp b/src/openrct2/core/Algorithm.hpp index a7072ca1e3..a245a345b6 100644 --- a/src/openrct2/core/Algorithm.hpp +++ b/src/openrct2/core/Algorithm.hpp @@ -9,6 +9,7 @@ #pragma once +#include #include template> diff --git a/src/openrct2/core/Imaging.cpp b/src/openrct2/core/Imaging.cpp index 7a7bc3f6b6..a0b3f351e8 100644 --- a/src/openrct2/core/Imaging.cpp +++ b/src/openrct2/core/Imaging.cpp @@ -19,6 +19,7 @@ #include "Memory.hpp" #include "String.hpp" +#include #include #include #include diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 57c368237e..5a5257c74c 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -24,6 +24,7 @@ #include "LightFX.h" #include "Weather.h" +#include #include using namespace OpenRCT2; diff --git a/src/openrct2/entity/EntityTweener.cpp b/src/openrct2/entity/EntityTweener.cpp index 4ad4a5bff8..bfaa87a24e 100644 --- a/src/openrct2/entity/EntityTweener.cpp +++ b/src/openrct2/entity/EntityTweener.cpp @@ -14,6 +14,7 @@ #include "EntityList.h" #include "EntityRegistry.h" +#include #include void EntityTweener::AddEntity(EntityBase* entity) diff --git a/src/openrct2/object/Object.cpp b/src/openrct2/object/Object.cpp index ada421bd26..ca2b46ee51 100644 --- a/src/openrct2/object/Object.cpp +++ b/src/openrct2/object/Object.cpp @@ -23,6 +23,7 @@ #include "ObjectLimits.h" #include "ObjectRepository.h" +#include #include #include diff --git a/src/openrct2/object/ObjectTypes.cpp b/src/openrct2/object/ObjectTypes.cpp index 0d7d6a3a16..af6aa715bd 100644 --- a/src/openrct2/object/ObjectTypes.cpp +++ b/src/openrct2/object/ObjectTypes.cpp @@ -12,6 +12,8 @@ #include "../util/Util.h" #include "Object.h" +#include + constexpr std::array kAllObjectTypes = { ObjectType::Ride, ObjectType::SmallScenery, diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index ec9c164418..1360d013a5 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -73,7 +73,10 @@ struct PaintStringStruct struct PaintEntry { private: - std::array data; + // Avoid including expensive for std::max. Manually ensure we use the largest type. + static_assert(sizeof(PaintStruct) >= sizeof(AttachedPaintStruct)); + static_assert(sizeof(PaintStruct) >= sizeof(PaintStringStruct)); + std::array data; public: PaintStruct* AsBasic() diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index f3dc9cf320..0f18aacac5 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -19,6 +19,7 @@ #include "../scenes/title/TitleScene.h" #include "zlib.h" +#include #include #include #include