I'm trying to port the following Visual C++ code to GCC:
typedef __declspec(align(16)) float float4;
This defines a new type, float4, which is an array of four floats, aligned on 16 bytes. GCC has an __align(16) specifier, which is almost equivalent to __declspec(align(16)), but it is not allowed in typedefs for some reason. I tried creating an aligned float4 struct type, but oddly this doesn't compile either. I'd really love to be able to use float4 directly everywhere I need an aligned vector.
Don't see why it wouldn't work, i use this:
class __attribute__((aligned(16))) Vector
and it compiled just fine the last time I compiled it using GCC, they might have changed it though...