X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d97d44e14d05f9a6da2c5414209b3858d47a520..78500b7db1287068a04469e1ce92b4fe99e4e4f0:/src/common/imagpng.cpp diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 016e594e2b..b41838fa22 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -56,20 +56,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler) #if wxUSE_LIBPNG -#if defined(__VISAGECPP__) -#define PNGLINKAGEMODE _Optlink -#elif defined(__WATCOMC__) && !defined(__DOS__) -#define PNGLINKAGEMODE _cdecl -#else -#define PNGLINKAGEMODE +#ifndef PNGLINKAGEMODE + #define PNGLINKAGEMODE LINKAGEMODE #endif -static void PNGLINKAGEMODE _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length ) +extern "C" +{ + +void PNGLINKAGEMODE _PNG_stream_reader( png_structp png_ptr, png_bytep data, png_size_t length ) { ((wxInputStream*) png_get_io_ptr( png_ptr )) -> Read(data, length); } -static void PNGLINKAGEMODE _PNG_stream_writer( png_structp png_ptr, png_bytep data, png_size_t length ) +void PNGLINKAGEMODE _PNG_stream_writer( png_structp png_ptr, png_bytep data, png_size_t length ) { ((wxOutputStream*) png_get_io_ptr( png_ptr )) -> Write(data, length); } @@ -95,6 +94,8 @@ PNGLINKAGEMODE png_silent_warning(png_structp WXUNUSED(png_ptr), png_const_charp { } +} // extern "C" + // temporarily disable the warning C4611 (interaction between '_setjmp' and // C++ object destruction is non-portable) - I don't see any dtors here #ifdef __VISUALC__