From 157ca46ce384fdbcce5a0778537a575c4e054b0b Mon Sep 17 00:00:00 2001 From: wiz Date: Mon, 17 Jan 2011 09:14:15 +0000 Subject: Fix build with png-1.5. --- geography/gdal-lib/distinfo | 3 ++- geography/gdal-lib/patches/patch-ab | 50 +++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 geography/gdal-lib/patches/patch-ab (limited to 'geography/gdal-lib') diff --git a/geography/gdal-lib/distinfo b/geography/gdal-lib/distinfo index 4d12d7cb312..50773eced32 100644 --- a/geography/gdal-lib/distinfo +++ b/geography/gdal-lib/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.10 2010/11/15 13:38:31 adam Exp $ +$NetBSD: distinfo,v 1.11 2011/01/17 09:14:15 wiz Exp $ SHA1 (gdal-1.7.3.tar.gz) = 58d4355fe792ad618bb74605dc1a084a0aeb7cb1 RMD160 (gdal-1.7.3.tar.gz) = ce84a12d48c85a58c56a17381aee1c4f2ba08b57 Size (gdal-1.7.3.tar.gz) = 7757684 bytes SHA1 (patch-aa) = 2c017bda45d4ed4fb10f7e70d33b707ca33149d1 +SHA1 (patch-ab) = 77c034b05151a7a300b302b79ba803212db297b1 diff --git a/geography/gdal-lib/patches/patch-ab b/geography/gdal-lib/patches/patch-ab new file mode 100644 index 00000000000..d4208ca9862 --- /dev/null +++ b/geography/gdal-lib/patches/patch-ab @@ -0,0 +1,50 @@ +$NetBSD: patch-ab,v 1.6 2011/01/17 09:14:15 wiz Exp $ + +Fix build with png-1.5. + +--- frmts/png/pngdataset.cpp.orig 2010-11-07 18:28:47.000000000 +0000 ++++ frmts/png/pngdataset.cpp +@@ -1296,7 +1296,7 @@ png_vsi_read_data(png_structp png_ptr, p + * instead of an int, which is what fread() actually returns. + */ + check = (png_size_t)VSIFReadL(data, (png_size_t)1, length, +- (png_FILE_p)png_ptr->io_ptr); ++ (png_FILE_p)png_get_io_ptr(png_ptr)); + + if (check != length) + png_error(png_ptr, "Read Error"); +@@ -1311,7 +1311,7 @@ png_vsi_write_data(png_structp png_ptr, + { + png_uint_32 check; + +- check = VSIFWriteL(data, 1, length, (png_FILE_p)(png_ptr->io_ptr)); ++ check = VSIFWriteL(data, 1, length, (png_FILE_p)(png_get_io_ptr(png_ptr))); + + if (check != length) + png_error(png_ptr, "Write Error"); +@@ -1322,7 +1322,7 @@ png_vsi_write_data(png_structp png_ptr, + /************************************************************************/ + static void png_vsi_flush(png_structp png_ptr) + { +- VSIFFlushL( (png_FILE_p)(png_ptr->io_ptr) ); ++ VSIFFlushL( (png_FILE_p)(png_get_io_ptr(png_ptr)) ); + } + + /************************************************************************/ +@@ -1338,10 +1338,13 @@ static void png_gdal_error( png_structp + // libpng is generally not built as C++ and so won't honour unwind + // semantics. Ugg. + +- jmp_buf* psSetJmpContext = (jmp_buf*) png_ptr->error_ptr; +- if (psSetJmpContext) ++ if (png_jmpbuf(png_ptr)) + { +- longjmp( *psSetJmpContext, 1 ); ++#if (PNG_LIBPNG_VER < 10500) ++ longjmp( (jmp_buf*) png_ptr->error_ptr, 1 ); ++#else ++ png_longjmp (png_ptr, 1); ++#endif + } + } + -- cgit v1.2.3