Page 1 of 1

[BUGFIX] SILLY and libpng15

Posted: Sun Feb 19, 2012 21:05
by Undefined
Here is my Patch for Building SILLIY-0.1.0 with libpng15

Code: Select all

/**
* @file   silly-0.1.0-libpng15.diff
* @since  Sun Feb 19 21:56:58 CET 2012
* @short  diff options:-Nau6
*/
--- ./src/loaders/SILLYPNGImageLoader.cpp.orig   2012-02-19 21:48:21.827658990 +0100
+++ ./src/loaders/SILLYPNGImageLoader.cpp   2012-02-19 21:56:21.368577116 +0100
@@ -38,12 +38,14 @@
 #include "loaders/SILLYPNGImageLoader.icpp"
 #undef inline
 #endif
 
 #include "loaders/SILLYPNGImageContext.h"
 #include <png.h>
+#include <zlib.h>
+
 // Start section of namespace SILLY
 namespace SILLY
 {
 void PNG_read_function(png_structp png_ptr, png_bytep data, png_size_t length)
 {
     PNGImageContext* png = reinterpret_cast<PNGImageContext*>(png_get_io_ptr(png_ptr));
@@ -63,13 +65,13 @@
 void PNG_error_function(png_structp png_ptr,
                         png_const_charp error)
 {
     //  printf("PNG Error: %s\n", error);
     // copied from libpng's pngerror.cpp
     jmp_buf buf;
-    memcpy(buf, png_ptr->jmpbuf, sizeof(jmp_buf));
+    memcpy(buf, png_jmpbuf(png_ptr), sizeof(jmp_buf));
     longjmp(buf, 1);
 }
 
 
 PNGImageLoader::PNGImageLoader()
     : ImageLoader("PNG Image Loader based on libpng")

Re: [BUGFIX] SILLY and libpng15

Posted: Mon Feb 20, 2012 11:54
by CrazyEddie
Thanks, I'll check it out soon.

CE.

Re: [BUGFIX] SILLY and libpng15

Posted: Tue Feb 21, 2012 03:56
by PaddyMac
Although I have not yet had an opportunity to actually use Silly, I can verify that Silly does compile with libpng 1.5.8 with this patch applied.

Re: [BUGFIX] SILLY and libpng15

Posted: Tue Feb 21, 2012 08:40
by CrazyEddie
Thanks for confirming it works for you.

CE.

Re: [BUGFIX] SILLY and libpng15

Posted: Tue Feb 21, 2012 15:26
by KishukuOni
I ran into the exact same thing oven the weekend. I also like Undefined's patch better than what I came up with.