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 1912 - png_const_bytep should not be used in libpng >= 14
Summary: png_const_bytep should not be used in libpng >= 14
Status: RESOLVED FIXED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-14 09:58 UTC by driedfruit
Modified: 2014-07-09 08:10 UTC (History)
1 user (show)

See Also:


Attachments
patch to fix the issue (966 bytes, text/plain)
2013-06-14 09:58 UTC, driedfruit
Details
Patch to provide png_const_bytep for libpng < 1.6 (387 bytes, patch)
2014-07-03 21:36 UTC, Maarten ter Huurne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description driedfruit 2013-06-14 09:58:06 UTC
Created attachment 1191 [details]
patch to fix the issue

The ifdef/typedef define the "png_bytep" type, for libpng12, but there are 2 instances in the code, when raw "png_const_bytep" is still used.

This breaks libpng14 compile.

libtool: compile:  gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_image\" -DVERSION=\"2.0.0\" -DLOAD_PNG=1 -DLOAD_PNG_DYNAMIC=\"libpng14.so.14\" -I. -I/usr/include/libpng14 -g -O2 -I/usr/local/include/SDL2 -D_REENTRANT -MT IMG_png.lo -MD -MP -MF .deps/IMG_png.Tpo -c IMG_png.c  -fPIC -DPIC -o .libs/IMG_png.o
IMG_png.c:102: error: expected ‘)’ before ‘sig’
IMG_png.c:104: error: expected ‘;’ before ‘jmp_buf’
Comment 1 Maarten ter Huurne 2014-07-03 21:36:41 UTC
Created attachment 1731 [details]
Patch to provide png_const_bytep for libpng < 1.6

I encountered the same issue compiling SDL2_image-2.0.0 against libpng 1.4.13. I have an even smaller patch to solve the issue, see attachment.
Comment 2 Sam Lantinga 2014-07-09 08:10:11 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL_image/rev/43873c313f32