Original Post
i want to write a macro to make struct/class packed.
should be something like :
PACKED(class myClass)
{
char aCharMember;
short aShortMember;
int anIntMember;
};
for example on g++, the PACKED-macro would expand to
class myClass __attribute((packed))
...
but what would it have to expand to on MSVC ?
i tried :
__declspec(align(1)) class myClass
...
-> seems not to work -> it only lets me set higher values than are defined by #pragma pack, or compiler options. lower values (like 1) are ignored.
is there some other way ? or is it somehow possible, to get the #pragma pack-directive into the PACKED-macro ?
any ideas ?