freebsd-ports/graphics/libgfx/files/patch-png.cxx
John Marino 942e944991 graphics/libgfx: #include <cstring>
This is fallout from png upgrade.  Modern GCC needs <cstring> for memcpy,
although clang seems to be happy without it.
2015-01-03 01:07:50 +00:00

28 lines
869 B
C++

--- src/raster-png.cxx.orig 2004-09-27 04:45:31 UTC
+++ src/raster-png.cxx
@@ -9,6 +9,7 @@
************************************************************************/
+#include <cstring>
#include <vector>
#include <gfx/gfx.h>
#include <gfx/raster.h>
@@ -42,7 +43,7 @@ ByteRaster *read_png_image(const char *f
// Because we didn't set up any error handlers, we need to be
// prepared to handle longjmps out of the library on error
// conditions.
- if( setjmp(png_ptr->jmpbuf) )
+ if( setjmp(png_jmpbuf(png_ptr)) )
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
fclose(fp);
@@ -132,7 +133,7 @@ bool write_png_image(const char *file_na
return false;
}
- if( setjmp(png_ptr->jmpbuf) )
+ if( setjmp(png_jmpbuf(png_ptr)) )
{
fclose(fp);
png_destroy_write_struct(&png_ptr, (png_infopp)NULL);