From: Antonio Quartulli ordex@autistici.org Date: Wed, 21 Nov 2012 13:11:59 +0100
+#pragma pack(2)
...
-} __packed;
The __packed attribute is an abstraction of the actual syntax the compiler uses, if it is supported at all.
Therefore, you can't just unconditionally use the #pragma, and you would need to use some kind of similar compiler abstraction for it.
But to be honest this is really ugly and for very little, if any, gain.