Skip to content

Commit

Permalink
Fixed building with libpng 1.4
Browse files Browse the repository at this point in the history
Owen Swerkstrom

in order to build SDL2_image, I had to edit IMG_png.c and change:

/* Check for the older version of libpng */
#if (PNG_LIBPNG_VER_MAJOR == 1)
#if (PNG_LIBPNG_VER_MINOR < 4)

...to:

/* Check for the older version of libpng */
#if (PNG_LIBPNG_VER_MAJOR == 1)
#if (PNG_LIBPNG_VER_MINOR < 5)

...since my installed 1.4.x version doesn't have "png_const_bytep"
defined, I'm guessing that's a 1.5.x thing.  This is probably not a
very "correct" fix, but it got me running.

I run a fairly stock Slackware 14.0, 64-bit.  LibPNG 1.4 and 1.2 are
installed (as part of the OS, not my doing).  I considered building
and installing 1.5 as well but figured out this workaround first.
  • Loading branch information
slouken committed Oct 12, 2013
1 parent ff7972b commit a987182
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IMG_png.c
Expand Up @@ -69,7 +69,7 @@

/* Check for the older version of libpng */
#if (PNG_LIBPNG_VER_MAJOR == 1)
#if (PNG_LIBPNG_VER_MINOR < 4)
#if (PNG_LIBPNG_VER_MINOR < 5)
#define LIBPNG_VERSION_12
typedef png_bytep png_const_bytep;
#endif
Expand Down

0 comments on commit a987182

Please sign in to comment.