-
Notifications
You must be signed in to change notification settings - Fork 2k
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
zlibWrapper/*.c files cannot be compiled with VS #1800
Comments
We are missing a build test of the I suspect we could add it somewhere here : |
Also, looking at the build script, it seems the source code is created to be compatible with This is not strict ansi |
In branch It should generate less warnings for Visual Studio. Limitations : |
While I could ensure C90 conformity in #1815 , |
In latest I've tested that the new source code compiles without warning on Visual Studio 2017. But I can't reproduce more specific issues such as linking a specific version of @bluenlive, if you have time, could you please have a look at latest |
@Cyan4973, your statement above: In latest dev branch update, zlibWrapper is not ISO-C90 compatible should be: In latest dev branch update, zlibWrapper is NOW ISO-C90 compatible Correct? |
correct, fixed |
@Cyan4973 Sorry for my late answer. In VS2019, one more fix is needed. I inserted following lines, and compilation was done.
|
As per #1800 (comment), Visual does not support `ssize_t` type, which is an issue for `gzread.c`. Added a work around, suggested by @bluenlive Note : I have not been able to confirm the problem, so this is a blind fix. This seems safe outside of Visual, since it is gated by _MSC_VER macro.
@Cyan4973 Thank you so much. |
Thank you for your great work!
Visual studio (any version) cannot compile *.c files in zlibWrapper folder.
Following line(s)(25 times) requires -Wstrict-aliasing=1 option.
state = (gz_statep)file;
But, VS doesn't support strict aliasing.
So, I think it's better to change those lines to:
*(void**)(&state) = (void*)file;
or
state.file = file;
And, VS doesn't define ssize_t type, but it is used in gzread.c
So, something like this is needed in gzread.c
#if defined(_MSC_VER) && !defined(ssize_t)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif
What do you think about these issue?
The text was updated successfully, but these errors were encountered: