Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | From c2067e8c16bfb721d339718ae0c99c70a994936b Mon Sep 17 00:00:00 2001 |
| 2 | From: iwamatsu <iwamatsu@7c53e7cc-98ea-0310-8f1f-a0b24da60408> |
| 3 | Date: Fri, 17 Jun 2011 20:35:07 +0000 |
| 4 | Subject: [PATCH 4/8] Add support libpng15 |
| 5 | |
| 6 | Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
| 7 | |
| 8 | git-svn-id: svn://svn.berlios.de/slim/trunk@178 7c53e7cc-98ea-0310-8f1f-a0b24da60408 |
| 9 | --- |
| 10 | Makefile | 4 ++-- |
| 11 | png.c | 6 +++++- |
| 12 | 2 files changed, 7 insertions(+), 3 deletions(-) |
| 13 | |
| 14 | diff --git a/Makefile b/Makefile |
| 15 | index fafa0ef..1202614 100644 |
| 16 | --- a/Makefile |
| 17 | +++ b/Makefile |
| 18 | @@ -5,9 +5,9 @@ |
| 19 | ####################################################### |
| 20 | CXX=/usr/bin/g++ |
| 21 | CC=/usr/bin/gcc-4.5 |
| 22 | -CFLAGS=-Wall -I. -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/libpng12 -I/usr/include |
| 23 | +CFLAGS=-Wall -I. -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include |
| 24 | CXXFLAGS=$(CFLAGS) |
| 25 | -LDFLAGS=-lXft -lX11 -lfreetype -lXrender -lfontconfig -lpng12 -lz -lm -lcrypt -lXmu -lpng -ljpeg -lrt |
| 26 | +LDFLAGS=-lXft -lX11 -lfreetype -lXrender -lfontconfig -lpng -lz -lm -lcrypt -lXmu -lpng -ljpeg -lrt |
| 27 | CUSTOM=-DHAVE_SHADOW |
| 28 | ifdef USE_PAM |
| 29 | LDFLAGS+= -lpam |
| 30 | diff --git a/png.c b/png.c |
| 31 | index 5c086c6..aa0f5e5 100644 |
| 32 | --- a/png.c |
| 33 | +++ b/png.c |
| 34 | @@ -57,8 +57,12 @@ read_png(const char *filename, int *width, int *height, unsigned char **rgb, |
| 35 | png_destroy_read_struct(&png_ptr, (png_infopp) NULL, |
| 36 | (png_infopp) NULL); |
| 37 | } |
| 38 | - |
| 39 | + |
| 40 | +#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 |
| 41 | + if (setjmp(png_jmpbuf((data->png_ptr)))) |
| 42 | +#else |
| 43 | if (setjmp(png_ptr->jmpbuf)) |
| 44 | +#endif |
| 45 | goto png_destroy; |
| 46 | |
| 47 | png_init_io(png_ptr, infile); |
| 48 | -- |
| 49 | 1.6.6.1 |
| 50 | |