/*****************************************************************************
- * RRDtool 1.2.99907080300 Copyright by Tobi Oetiker, 1997-2007
+ * RRDtool 1.3.2 Copyright by Tobi Oetiker, 1997-2008
*****************************************************************************
* pngsize.c determine the size of a PNG image
*****************************************************************************/
/* this is to make compile on aix work since they seem to define jmpbuf
to be _jmpbuf which breaks compilation */
+#ifndef png_jmpbuf
+#ifdef PNG_SETJMP_SUPPORTED
+# define png_jmpbuf(png_ptr) ((png_ptr)->PNG_jmpbuf)
+#else
#ifdef jmpbuf
#undef jmpbuf
#endif
-
-#ifndef png_jmpbuf
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
#endif
+#endif
- if (setjmp(png_jmpbuf(png_read_ptr))){
- png_destroy_read_struct(&png_read_ptr, &info_ptr, (png_infopp)NULL);
- return 0;
- }
+ if (setjmp(png_jmpbuf(png_read_ptr))) {
+ png_destroy_read_struct(&png_read_ptr, &info_ptr, (png_infopp) NULL);
+ return 0;
+ }
png_init_io(png_read_ptr, fd);
png_read_info(png_read_ptr, info_ptr);