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 2636

Summary: Changeset 461 breaks build on Linux with libpng v1.5
Product: SDL_image Reporter: Joe LeVeque <joeleveque>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2    
Version: unspecified   
Hardware: x86   
OS: Linux   

Description Joe LeVeque 2014-07-10 17:35:23 UTC
It appears as though png_const_bytep is already defined in libpng v1.5, and thus this changeset creates a multiple define. To fix, png_const_bytep should only be defined for libpng < 1.5, as follows:

/* Check for the older version of libpng */
#if (PNG_LIBPNG_VER_MAJOR == 1)
#if (PNG_LIBPNG_VER_MINOR < 5)
#define LIBPNG_VERSION_12
#endif
#if (PNG_LIBPNG_VER_MINOR < 5)
typedef png_bytep png_const_bytep;
#endif
#if (PNG_LIBPNG_VER_MINOR < 6)
typedef png_structp png_const_structrp;
typedef png_infop png_const_inforp;
#endif
#endif
Comment 1 Sam Lantinga 2014-07-11 06:00:46 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL_image/rev/4078e65827ea