Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make C API layout-compatible with miniz #79

Open
Shnatsel opened this issue Jun 6, 2020 · 2 comments
Open

Make C API layout-compatible with miniz #79

Shnatsel opened this issue Jun 6, 2020 · 2 comments
Labels

Comments

@Shnatsel
Copy link
Contributor

Shnatsel commented Jun 6, 2020

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.

@oyvindln
Copy link
Collaborator

oyvindln commented Jun 7, 2020

Ah nice.

@oyvindln
Copy link
Collaborator

oyvindln commented Nov 11, 2021

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.)

@oyvindln oyvindln added the C API label Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants