3 ms·
There’s also a directive (don’t have code in front of me) that you can do at file level that will cause all subsequent struct defs to be packed… #push(pragma(p
by travisgriggs 2y ago
There’s also a directive (don’t have code in front of me) that you can do at file level that will cause all subsequent struct defs to be packed…
#push(pragma(pack(0)) ??
I’ve done a lot of direct register access in C this way. I do like Zigs ability to just define the different sizes though.
- mananaysiempre 2y agoIt’s MS(V)C syntax, now supported by GCC and Clang as well: #pragma pack(push) #pragma pack(1) /* ... */ #pragma pack(pop) The first two lines can also be condensed into #pragma pack(push, 1)