mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Fixes for C++ compilation using g++ When libpng source is compiled
using g++. The compiler imposes C++ rules on the C source; thus it
is desireable to make the source work with either C or C++ rules
without throwing away useful error information. This change adds
png_voidcast to allow C semantic (void*) cases or the corresponding
C++ static_cast operation, as appropriate.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
c2d8399581
commit
4fa96a42f7
4
png.c
4
png.c
@@ -3028,7 +3028,7 @@ png_byte png_sRGB_delta[512] =
|
||||
static int
|
||||
png_image_free_function(png_voidp argument)
|
||||
{
|
||||
png_imagep image = argument;
|
||||
png_imagep image = png_voidcast(png_imagep, argument);
|
||||
png_controlp cp = image->opaque;
|
||||
png_control c;
|
||||
|
||||
@@ -3042,7 +3042,7 @@ png_image_free_function(png_voidp argument)
|
||||
# ifdef PNG_STDIO_SUPPORTED
|
||||
if (cp->owned_file)
|
||||
{
|
||||
FILE *fp = cp->png_ptr->io_ptr;
|
||||
FILE *fp = png_voidcast(FILE*, cp->png_ptr->io_ptr);
|
||||
cp->owned_file = 0;
|
||||
|
||||
/* Ignore errors here. */
|
||||
|
||||
Reference in New Issue
Block a user