But in wikipedia i found:Although the standard didn't provide any control in customizing the alignment and padding rules, many compilers provide this through non-standard extensions.
...some compilers use #pragma directives to specify packing inside source files...
Code: Select all
#pragma pack(push) /* push current alignment to stack */
#pragma pack(1) /* set alignment to 1 byte boundary */
struct MyPackedData
{
char Data1;
long Data2;
char Data3;
};
#pragma pack(pop) /* restore original alignment from stack */
Just to stop those already writing "use search", this has nothing to do with __attribute__((aligned(16))) and i'm not experimenting directly the above code because my app has unexpected behaviours at the moment and i would not recognize the changes. If someone already had the same problem and wish to save me time writing some test code, then feel free to tell me if "#pragma pack(1) " works properly, or otherwise what's the pspsdk replacement if any. Thanks for your attention.The above directives are available in compilers from Microsoft, Borland, GNU and many others.