[+] AU_ALIGN

[*] Enforce reasonable SOO alignment
This commit is contained in:
Reece Wilson 2023-08-18 12:48:28 +01:00
parent 936400c1b6
commit b76a0a810e
3 changed files with 10 additions and 7 deletions

View File

@ -157,6 +157,14 @@
#define AU_FWD(var) AuForward<decltype(var)>(var)
#endif
#if !defined(AU_ALIGN)
#if defined(AURORA_COMPILER_MSVC)
#define AU_ALIGN(uSize) __declspec(align(uSize))
#else
#define AU_ALIGN(uSize) __attribute__((aligned(uSize)))
#endif
#endif
#if defined(_AURORA_MISSING_STD_EXCEPTION)
#define AuStringException AuString

View File

@ -39,7 +39,7 @@
vis ~type();
#define AUROXTL_INTERFACE_SOO_HDR_EX2(vis, Type, extends, targetSize, ex, ...) \
struct Type ## SOO \
struct AU_ALIGN(sizeof(AuUInt)) Type ## SOO \
{ \
AU_WHAT ex \
AUROXTL_INTERFACE_SOO_HDR_(vis, Type ## SOO, targetSize, ## __VA_ARGS__) \

View File

@ -397,12 +397,7 @@ template <class F, class... Args>
constexpr auto AuIsCallable_v = AuCallable<F, Args...>::value;
template <AuUInt uSize, class T>
struct
#if defined(AURORA_COMPILER_MSVC)
__declspec(align(uSize))
#else
__attribute__((aligned(uSize)))
#endif
struct AU_ALIGN(uSize)
AuAlignTo : T
{
};