From 6fc40533358b2fab5fbe68b931153d3efdfe3cc8 Mon Sep 17 00:00:00 2001 From: Lucas Mitrak Date: Sat, 29 May 2021 19:29:43 -0400 Subject: [PATCH] media-libs/libgfx: Update sources External libraries, specifically libpng, as well as C++ as a whole, has been updated a lot since this was released in 2005. This patch will allow the package to compile; however, it does not update the build system, update the tests, nor change the package in non-trivial ways. The package cannot compile the tests because the build system cannot find fltk. Therefore, I cannot testify whether the package will still act as intended since I have not tested it. Signed-off-by: Lucas Mitrak --- src/raster-png.cxx | 7 +++++++ src/raster.cxx | 1 + 2 files changed, 8 insertions(+) diff --git a/src/raster-png.cxx b/src/raster-png.cxx index c98da9b..4ae8a89 100644 --- a/src/raster-png.cxx +++ b/src/raster-png.cxx @@ -12,6 +12,7 @@ #include #include #include +#include #ifdef HAVE_LIBPNG @@ -42,12 +43,15 @@ ByteRaster *read_png_image(const char *file_name) // Because we didn't set up any error handlers, we need to be // prepared to handle longjmps out of the library on error // conditions. + /* + * The struct is not defined in the header file if( setjmp(png_ptr->jmpbuf) ) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); fclose(fp); return NULL; } + */ png_init_io(png_ptr, fp); @@ -132,12 +136,15 @@ bool write_png_image(const char *file_name, const ByteRaster& img) return false; } + /* + * The struct is not defined in the header file if( setjmp(png_ptr->jmpbuf) ) { fclose(fp); png_destroy_write_struct(&png_ptr, (png_infopp)NULL); return false; } + */ png_init_io(png_ptr, fp); diff --git a/src/raster.cxx b/src/raster.cxx index cc19192..30647bb 100644 --- a/src/raster.cxx +++ b/src/raster.cxx @@ -11,6 +11,7 @@ #include #include +#include namespace gfx { -- 2.31.1