oleg-st / ZstdSharp

Port of zstd compression library to c#
MIT License
217 stars 29 forks source link

Fix IL2CPP #25

Closed in0finite closed 1 year ago

in0finite commented 1 year ago

Fixes #24

oleg-st commented 1 year ago

#if ENABLE_IL2CPP will only work at compile time, it will not be present in the assembly. So IL2CPP will not have this information when converting from dll to cpp. You need a separate assembly compiled with this option and type substitutions.

in0finite commented 1 year ago

From Unity side, you only need 1 assembly, the one which is compiled with ENABLE_IL2CPP. This assembly works both with NET runtime and IL2CPP.

This is currently the only way to make this library work with IL2CPP, so for that reason I would allow this directive to be defined in the library - if not defined, it doesn't change anything in the project.

oleg-st commented 1 year ago

Replacing native integer types with 64-bit ones will result in performance degradation on 32-bit platforms. Besides, it means changing the public API, which may lead to compatibility problems between versions.

For these reasons a fix in Unity is more preferable, until it is not available you can use a separately built library for Unity.

oleg-st commented 1 year ago

A Unity fix is coming, so I'll close this.