Click here to Skip to main content
15,794,374 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm trying to rewrite an iOS app from objective c into swift.
I'm using serialization in order to send data over some sort of communication layer.
In objective c I used #pragma pack (1) at the top of each struct in order to use sequential layout without padding between the data members.
I tried to use PRAGMA_STRUCT_PACK at the top of the struct.
It seems to work at the playground, but when implementing it in my app, I got an error message saying: "Expressions are not allowed at the top level".
Mike Nordell 12-Feb-15 21:00pm    
While I don't know anything about that environment, could perhaps __attribute__((packed)) work?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900