From cac2cbc7742cdf4b1dc3da0004d0bfc93e8f2e87 Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Sun, 15 Oct 2023 19:20:47 +0300 Subject: [PATCH] fix field alignment by doing max --- loader/include/Geode/modify/Field.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/loader/include/Geode/modify/Field.hpp b/loader/include/Geode/modify/Field.hpp index 8cf95adde..82a7e7514 100644 --- a/loader/include/Geode/modify/Field.hpp +++ b/loader/include/Geode/modify/Field.hpp @@ -1,9 +1,9 @@ #pragma once +#include "../utils/MiniFunction.hpp" #include "Traits.hpp" #include -#include "../utils/MiniFunction.hpp" #include #include @@ -49,8 +49,7 @@ namespace geode::modifier { } }; - [[deprecated("Will be removed in 1.0.0")]] - GEODE_DLL size_t getFieldIndexForClass(size_t hash); + [[deprecated("Will be removed in 1.0.0")]] GEODE_DLL size_t getFieldIndexForClass(size_t hash); GEODE_DLL size_t getFieldIndexForClass(char const* name); template @@ -58,7 +57,7 @@ namespace geode::modifier { using Intermediate = Modify; // Padding used for guaranteeing any member of parents // will be in between sizeof(Intermediate) and sizeof(Parent) - alignas(Base) uintptr_t m_padding; + alignas(std::max(alignof(Base), alignof(uintptr_t))) uintptr_t m_padding; public: // the constructor that constructs the fields. @@ -120,7 +119,7 @@ namespace geode::modifier { reinterpret_cast(offsetField) - sizeof(Intermediate) ); } - + Parent* self() { return this->operator Parent*(); }