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 [mz_zip.c] more modular #478

Closed
karimhm opened this issue May 10, 2020 · 4 comments
Closed

Make [mz_zip.c] more modular #478

karimhm opened this issue May 10, 2020 · 4 comments
Labels
distribution Release distribution

Comments

@karimhm
Copy link

karimhm commented May 10, 2020

In mz_zip.c the library check for both, HAVE_ZLIB and HAVE_LIBCOMP flags and then uses the Zlib interface even though on Apple platforms it might use the Libcomp interface that is "Catfishing" Zlib.

https://github.com/nmoinvaz/minizip/blob/b39f7a0e896615833a5af9dc7134563917a3a227/mz_zip.c#L1885-L1888

Wouldn't something like be better?

#if defined(HAVE_ZLIB)
    else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_DEFLATE)
        mz_stream_zlib_create(&zip->compress_stream);
#endif
#if defined(HAVE_LIBCOMP)
    else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_DEFLATE)
        mz_stream_libcomp_create(&zip->compress_stream);
#endif
@karimhm
Copy link
Author

karimhm commented May 10, 2020

When trying to compile the library on Apple platform mz_strm_zlib.[h/c] and mz_strm_libcomp.[h/c] cannot coexist due to duplicated symbols issue.

@nmoinvaz
Copy link
Member

Are you using CMake to generate xcode project? It should prevent this type of scenario.

@karimhm
Copy link
Author

karimhm commented May 26, 2020

No I'm using Swift Package Manager. I manually copied source files.

@SilenceWater
Copy link

Making the project private with CocoapoDS won't unzip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distribution Release distribution
Projects
None yet
Development

No branches or pull requests

3 participants