my current project requires me to communicate between 32 bit and 64 bit builds of Juce via IPC (InterProcessConnection). The protocol I’ve implemented involves the exchange of simple, flat structs that consist of 32/64 bit agnostic primitive types (uint32, char, bool, etc). Currently I simply push these as MemoryBlocks over the wire. I am not doing any endianess conversion, because I will not support PPC anyway.
The compiler however uses a different structure padding on 32 bit and 64 bit builds, so the structs do not align at both ends.
I really want to avoid any form of complex object marshalling (XML or similar), because that would be too much overhead in a real-time context.
Is there a way to force the same padding for both architectures? I know I can pack the structs to 1 byte alignment on Windows and OSX, but would much prefer to pack them to the 32 bit default padding in the 64 bit build instead. My client application needs the 32 bit default padding internally, so that’s an important point.
Any idea how to do that? How are you dealing this?