The R Project SVN R

Rev

Rev 44641 | Rev 51087 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 44641 Rev 51085
Line 63... Line 63...
63
   in a different thread from the one where R runs.
63
   in a different thread from the one where R runs.
64
*/
64
*/
65
static void my_png_error(png_structp png_ptr, png_const_charp msg)
65
static void my_png_error(png_structp png_ptr, png_const_charp msg)
66
{
66
{
67
    R_ShowMessage((char *) msg);
67
    R_ShowMessage((char *) msg);
-
 
68
#if PNG_LIBPNG_VER < 10400
68
    longjmp(png_ptr->jmpbuf,1);
69
    longjmp(png_ptr->jmpbuf,1);
-
 
70
#else
-
 
71
    longjmp(png_jmpbuf(png_ptr),1);
-
 
72
#endif
69
}
73
}
70
 
74
 
71
static void my_png_warning(png_structp png_ptr, png_const_charp msg)
75
static void my_png_warning(png_structp png_ptr, png_const_charp msg)
72
{
76
{
73
    warning("libpng: %s",(char *) msg);
77
    warning("libpng: %s",(char *) msg);
Line 113... Line 117...
113
    }
117
    }
114
 
118
 
115
    /* Set error handling.  REQUIRED if you aren't supplying your own
119
    /* Set error handling.  REQUIRED if you aren't supplying your own
116
     * error handling functions in the png_create_write_struct() call.
120
     * error handling functions in the png_create_write_struct() call.
117
     */
121
     */
-
 
122
#if PNG_LIBPNG_VER < 10400
118
    if (setjmp(png_ptr->jmpbuf)) {
123
    if (setjmp(png_ptr->jmpbuf))
-
 
124
#else
-
 
125
    if (setjmp(png_jmpbuf(png_ptr)))
-
 
126
#endif
-
 
127
{    
119
	/* If we get here, we had a problem writing the file */
128
	/* If we get here, we had a problem writing the file */
120
	free(scanline);
129
	free(scanline);
121
	png_destroy_write_struct(&png_ptr, &info_ptr);
130
	png_destroy_write_struct(&png_ptr, &info_ptr);
122
	return 0;
131
	return 0;
123
    }
132
    }