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

Win32 build #25

Merged
merged 2 commits into from
May 24, 2018
Merged

Win32 build #25

merged 2 commits into from
May 24, 2018

Conversation

Jehan
Copy link

@Jehan Jehan commented May 24, 2018

For GIMP, we need libheif to build for Windows. Here are the commits which resulted after failing to build (now it builds fine).

@@ -19,7 +19,6 @@
*/

#include <assert.h>
#include <alloca.h>
Copy link
Member

Choose a reason for hiding this comment

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

You have to include stdlib.h now for malloc/free (see error in Travis)..

@@ -103,5 +102,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {

quit:
heif_context_free(ctx);
free (image_IDs);
Copy link
Member

Choose a reason for hiding this comment

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

No whitespace between function name and parameters.

@@ -896,7 +896,8 @@ Error HeifPixelImage::fill_RGB_16bit(uint16_t r, uint16_t g, uint16_t b, uint16_
int stride = plane.stride;
uint8_t* data = plane.mem.data();

uint16_t val16;
// initialization only to avoid a warning of uninitalized variable.
uint16_t val16 = r;
Copy link
Member

Choose a reason for hiding this comment

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

Please set to 0 in the default case below before the assert instead.

@fancycode
Copy link
Member

Btw, which compiler are you using? We are testing with AppVeyor where building with Visual Studio 14 2015 succeeds.

Jehan added 2 commits May 24, 2018 23:28
Use malloc() instead of alloca() and properly free the allocated memory.
Fixes build error:
> fatal error: alloca.h: No such file or directory
Actually the only code path where val16 may be uninitialized would end
up in assert(), so that's impossible. But that still broke gcc
cross-compilation here, even more since all warnings are treated as
errors. So let's just initialize the variable to something.
Fixes:
> error: 'val16' may be used uninitialized in this function [-Werror=maybe-uninitialized]
@Jehan
Copy link
Author

Jehan commented May 24, 2018

Sorry for the style bugs. We are the first to ask of contributors to follow our style guidelines. I should have been more careful. ;-)
Anyway I fixed and rebased the commits.

Btw, which compiler are you using? We are testing with AppVeyor where building with Visual Studio 14 2015 succeeds.

I cross-build from Linux with mingw-w64.

@fancycode
Copy link
Member

I cross-build from Linux with mingw-w64.

Hmm, we should cover that with Travis then 😄

PR looks good now, thanks! I'll merge when CI is green.

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

Successfully merging this pull request may close these issues.

None yet

2 participants