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

Bring the Z_SOLO define back, just for the zlib.h compat header? #943

Closed
valpackett opened this issue May 3, 2021 · 2 comments
Closed
Labels
Compatibility API/ABI Compatibility issue

Comments

@valpackett
Copy link
Contributor

Some software relies on the fact that #define Z_SOLO would allow using names like compress and uncompress for their own static variables, and because zlib-ng killed the #ifndef Z_SOLO around "utility functions" in the header, boom:

/usr/src/sbin/savecore/savecore.c:108:23: error: redefinition of 'compress' as different kind of symbol
static bool checkfor, compress, uncompress, clear, force, keep; /* flags */
                      ^
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/zlib.h:1205:23: note: previous definition is here
Z_EXTERN int Z_EXPORT compress(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
                      ^
/usr/src/sbin/savecore/savecore.c:108:33: error: redefinition of 'uncompress' as different kind of symbol
static bool checkfor, compress, uncompress, clear, force, keep; /* flags */
                                ^
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/zlib.h:1241:23: note: previous definition is here
Z_EXTERN int Z_EXPORT uncompress(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
                      ^

Arguably using these names is Not A Good Idea and the software should be changed, but bringing these ifdefs back would improve compatibility.

@mtl1979
Copy link
Collaborator

mtl1979 commented May 3, 2021

We could do it for compatibility mode, as that is supposed to be backwards compatible with zlib... For non-compatibility mode, we prefix most externally visible functions already...

@nmoinvaz
Copy link
Member

This is part of 2.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compatibility API/ABI Compatibility issue
Projects
None yet
Development

No branches or pull requests

3 participants