PACKED for emulator? | developer.brewmp.com PACKED for emulator? | developer.brewmp.com

Developer

PACKED for emulator?

Hi,

I am developing an app for BREW 2.0.

I tried to declare a PACKED structure but when I try to find sizeof(myStruct) on the emulator, it gives me the size corresponding to the size that would have been correspoding to the size if the struct where aligned.

Does visual c++ support packing of structures?

Thanks

The PACKED macro in BREW is specific to the ARMCC compiler. MSVC does packed with #pragma in such a way that it can't be fit into one macro. So to pack a structure on both target and simulator, you need to use both PACKED (or GCCPACKED for gcc) and #pragma pack.

The PACKED macro in BREW is specific to the ARMCC compiler. MSVC does packed with #pragma in such a way that it can't be fit into one macro. So to pack a structure on both target and simulator, you need to use both PACKED (or GCCPACKED for gcc) and #pragma pack.

Thanks for your reply.
I just used #pragma and it seems to be packing my struct the way I desire on the emulator.
Thanks

Thanks for your reply.
I just used #pragma and it seems to be packing my struct the way I desire on the emulator.
Thanks

What exactly is your macro definitions for GCCPACKED? I have not seen this in the GCC docs.

What exactly is your macro definitions for GCCPACKED? I have not seen this in the GCC docs.