Make C API layout-compatible with miniz
Opened this issue · 2 comments
The README mentions that exporting miniz-compatible headers is blocked on an upstream cbindgen issue. However, a workaround for that issue was devised: mozilla/cbindgen#326 (comment)
So it should be possible to export layout-compatible structures once again.
Ah nice.
I've now used the workaround and using cbindgen-exported headers, and as of d235075 miniz C and C++ test stuff compiles with it.
Not yet sure if the compress/decompress structs should be only offered as opaque or not, seems some projects put them on the stack (i.e one of the examples) or manually allocate them which means they have to be defined and contain pointers to internal states.
(Also needed to include time.h in miniz_zip.h for the examples and one used miniz_tinfl.h instead of the full miniz.h.)