Code

Imported upstream version 1.3rc9.
[pkg-rrdtool.git] / src / pngsize.c
index dc2cc368c4d040d716cec906b5393c759fdd4cb7..1a7b4378948d818ca6de1897eb6c66acfc51da9a 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.3rc6  Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.3rc9  Copyright by Tobi Oetiker, 1997-2008
  *****************************************************************************
  * pngsize.c  determine the size of a PNG image
  *****************************************************************************/
@@ -27,12 +27,15 @@ int PngSize(
 /* this is to make compile on aix work since they seem to define jmpbuf
    to be _jmpbuf which breaks compilation */
 
-#ifdef jmpbuf
-#undef jmpbuf
-#endif
-
 #ifndef png_jmpbuf
+#ifdef PNG_SETJMP_SUPPORTED
+#  define png_jmpbuf(png_ptr)   ((png_ptr)->PNG_jmpbuf)
+#else
+#ifdef jmpbuf  
+#undef jmpbuf  
+#endif  
 #  define png_jmpbuf(png_ptr)   ((png_ptr)->jmpbuf)
+#endif
 #endif
 
     if (setjmp(png_jmpbuf(png_read_ptr))) {