Closed Maschell closed 2 years ago
Does using WUT_ALIGNAS not work for this? We already use it on some other structures.
wut\include\wut_structsize.h:
37: #define WUT_ALIGNAS(x) alignas(x)
39: #define WUT_ALIGNAS(x) __attribute__((__aligned__(x)))
wut\include\coreinit\context.h:
19: struct WUT_ALIGNAS(8) OSContext
wut\include\coreinit\spinlock.h:
17: struct WUT_ALIGNAS(16) OSSpinLock
wut\include\coreinit\thread.h:
120: struct WUT_ALIGNAS(8) OSThread
Oh wait is it because it needs WUT_PACKED but also align?
Might be able to use WUT_ALIGNAS on the first variable in that case.
The advantages of this approach is that it works in all cases, cause the correct alignment will always be forced. With WUT_ALIGNAS there are still way to bypass the aligment (on the heap) and the function happily returns "success", not informing that something went wrong.
Previously getting metaXML didn't work when the ACPMetaXml ptr was not aligned to 0x40, this implementation enforces the correct alignment.