Comment by account42

7 years ago

> well there is this: #ifdef _MSC_VER __declspec( align(16) ) struct float4 { float v[4]; }; #else struct float4 { float v[4]; } __attribute__ ((aligned(16))); #endif

I don't understand what you are trying to say here? Why not just use

    struct alignas(16) float4 { float v[4]; };

You can even put both __declspec( align(16) ) and __attribute__ ((aligned(16))) in the same place if you want to have a fallback for older compilers.