We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3919 - [Patch] IMG_png.c fails to compile with libpng 1.5
Summary: [Patch] IMG_png.c fails to compile with libpng 1.5
Status: RESOLVED FIXED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-24 18:57 UTC by Ethan Lee
Modified: 2017-11-22 05:38 UTC (History)
1 user (show)

See Also:


Attachments
Patch to fix compilation for libpng < 1.6 (673 bytes, patch)
2017-11-20 18:01 UTC, Ethan Lee
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ethan Lee 2017-10-24 18:57:29 UTC
The latest version of SDL_image will fail to compile as a result of it depending on libpng 1.6. The problem commit is likely this one:

https://hg.libsdl.org/SDL_image/rev/ace61a625208

It probably just needs some new typedefs, similar to this commit:

https://hg.libsdl.org/SDL_image/rev/777206f89dd2
Comment 1 stef 2017-11-15 14:35:07 UTC
It also fails to compile with libsdl 1.2.50.

The necessary typedefs are:

typedef png_structp png_structrp;
typedef png_infop png_inforp;
typedef const png_color * png_const_colorp;

I'd guess, that those also fix building with 1.5
Comment 2 stef 2017-11-15 14:40:23 UTC
> It also fails to compile with libsdl 1.2.50.

sry, s/libsdl/libpng/
Comment 3 Ethan Lee 2017-11-20 18:01:20 UTC
Created attachment 3095 [details]
Patch to fix compilation for libpng < 1.6

Can confirm that stef's fix works for libpng 1.5 as well. Here's the patch to resolve this issue. (Mind the Parent, this was committed on top of my patch for #3972)
Comment 4 Sam Lantinga 2017-11-22 05:38:01 UTC
Added, thanks!
https://hg.libsdl.org/SDL_image/rev/218eb926ba90