On Thu, 14 May 2020 at 16:03, Henry Vermaak <henry.verm...@gmail.com> wrote:
> So why is rtl/win*/* full of packrecords c? These pages say that the > Windows API expect 8: > > https://docs.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers#controlling-structure-packing > https://docs.microsoft.com/en-gb/cpp/build/reference/zp-struct-member-alignment If I do something like `echo '#include <wincred.h>' | gcc -E -dMD -P - | grep -i pack` I get this: #undef _CRT_PACKING #define _CRT_PACKING 8 #pragma pack(push,_CRT_PACKING) #pragma pack(pop) Before any of wincred.h gets defined, so the packing gets popped and it'll use the natural packing for the structs in wincred.h, which is why packrecords c works in my code. How does one know which header uses 8 bytes and which uses natural packing? (Apart from checking mingw like this, which to be fair has never let me down with winapi programming). Henry _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel