mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-10 12:04:36 -04:00
change the alignment things
This commit is contained in:
parent
7d79ddde30
commit
1a513ec3c6
2 changed files with 3 additions and 3 deletions
loader/include/Geode/modify
|
@ -58,7 +58,7 @@ namespace geode::modifier {
|
|||
using Intermediate = Modify<Parent, Base>;
|
||||
// Padding used for guaranteeing any member of parents
|
||||
// will be in between sizeof(Intermediate) and sizeof(Parent)
|
||||
alignas(std::max(alignof(Base), alignof(uintptr_t))) uintptr_t m_padding;
|
||||
std::aligned_storage_t<std::alignment_of_v<Base>, std::alignment_of_v<Base>> m_padding;
|
||||
|
||||
public:
|
||||
// the constructor that constructs the fields.
|
||||
|
|
|
@ -100,8 +100,8 @@ namespace geode::modifier {
|
|||
|
||||
// unordered_map<handles> idea
|
||||
ModifyBase() {
|
||||
static constexpr bool hasImproperCustomFields =
|
||||
sizeof(typename ModifyDerived::Derived) != sizeof(typename ModifyDerived::Base) + std::max(std::alignment_of_v<typename ModifyDerived::Base>, sizeof(uintptr_t));
|
||||
static constexpr bool hasImproperCustomFields = sizeof(typename ModifyDerived::Derived) >= 1 &&
|
||||
sizeof(typename ModifyDerived::Derived) != sizeof(typename ModifyDerived::Base) + std::alignment_of_v<typename ModifyDerived::Base>;
|
||||
static_assert(!hasImproperCustomFields,
|
||||
"\n--- Error in modify class:\n"
|
||||
" Do not add members to a modify class, use `struct Fields` instead.\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue