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

Fix compilation of ModelicaMatIO.c if HAVE_ZLIB=0 is defined #3085

Merged
merged 2 commits into from Aug 22, 2019

Conversation

beutlich
Copy link
Member

@beutlich beutlich commented Aug 9, 2019

If HAVE_ZLIB=0 is defined, no zlib will be used.

@beutlich beutlich added bug Critical/severe issue L: C-Sources Issue addresses Modelica/Resources/C-Sources labels Aug 9, 2019
@beutlich beutlich added this to the MSL4.0.0 milestone Aug 9, 2019
@beutlich beutlich self-assigned this Aug 9, 2019
Copy link
Member

@sjoelund sjoelund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the wrong fix. If you have HAVE_ZLIB=0, I guess the intention is to not compile with zlib, but you do compile with zlib if it is 0. A better fix would be to use if HAVE_ZLIB everywhere, or at the top (before including zlib.h):

#if defined(HAVE_ZLIB) && !HAVE_ZLIB
#undef HAVE_ZLIB
#endif

The autotools job either sets HAVE_ZLIB=1 or does not set it at all so it will not have a problem compiling the existing sources.

@beutlich
Copy link
Member Author

And similar for HAVE_HDF5, right?

@beutlich beutlich requested a review from sjoelund August 10, 2019 09:49
Copy link
Contributor

@HansOlsson HansOlsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Looks good, and I agree that it is usual preprocessor style to use #if X" instead of "#if defined(X)".

@beutlich beutlich merged commit 9af2e8c into modelica:master Aug 22, 2019
@beutlich beutlich deleted the fix-compilation branch August 22, 2019 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue L: C-Sources Issue addresses Modelica/Resources/C-Sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants