From 63c5d89910c5b074737e6afcf49ad643a9442d4d Mon Sep 17 00:00:00 2001 From: wiz Date: Sat, 29 Jan 2011 11:24:43 +0000 Subject: Fix build with png-1.5. --- x11/fbdesk/patches/patch-ac | 145 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 x11/fbdesk/patches/patch-ac (limited to 'x11/fbdesk/patches') diff --git a/x11/fbdesk/patches/patch-ac b/x11/fbdesk/patches/patch-ac new file mode 100644 index 00000000000..470b7ec0858 --- /dev/null +++ b/x11/fbdesk/patches/patch-ac @@ -0,0 +1,145 @@ +$NetBSD: patch-ac,v 1.1 2011/01/29 11:24:43 wiz Exp $ + +Fix build with png-1.5. + +--- src/FbTk/ImagePNG.cc.orig 2004-09-20 14:04:11.000000000 +0000 ++++ src/FbTk/ImagePNG.cc +@@ -76,6 +76,8 @@ ImagePNG::~ImagePNG() { + } + + PixmapWithMask *ImagePNG::load(const std::string &filename, int screen_num) const { ++ int pixel_depth; ++ int rowbytes; + if (filename.empty()) + return 0; + #ifdef DEBUG +@@ -102,7 +104,7 @@ PixmapWithMask *ImagePNG::load(const std + return 0; + } + +- if (setjmp(png.png()->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png.png()))) { + fclose(fp); + return 0; + } +@@ -115,12 +117,14 @@ PixmapWithMask *ImagePNG::load(const std + png_get_IHDR(png.png(), png.info(), &w, &h, + &bit_depth, &color_type, + &interlace_type, 0, 0); ++ pixel_depth = bit_depth * png_get_channels(png.png(), png.info()); ++ rowbytes = png_get_rowbytes(png.png(), png.info()); + #ifdef DEBUG +- cerr<width<<", "<height<pixel_depth<<" to 32bpp."<channels != 4) ? 0xFF000000 : 0); ++ int alphacolor = ((png_get_channels(png.png(), png.info()) != 4) ? 0xFF000000 : 0); + if (big_endian) { +- int shift = ((png.info()->channels == 4) ? 0 : 8); ++ int shift = ((png_get_channels(png.png(), png.info()) == 4) ? 0 : 8); + alphacolor = (0xFF >> shift); + } + screen_surf.setColorKey(alphacolor, true); -- cgit v1.2.3