pnmimagetypes: Fix compile error with some versions of png.h

Some define these as macros, which interferes with these definitions
This commit is contained in:
rdb 2023-02-24 22:21:27 +01:00
parent 79ba760319
commit a5be6fa5ff
2 changed files with 12 additions and 12 deletions

View File

@ -453,8 +453,8 @@ png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
* This is our own warning handler. It is called by the png library to issue
* a warning message.
*/
void PNMFileTypePNG::Reader::
png_warning(png_structp, png_const_charp warning_msg) {
void (PNMFileTypePNG::Reader::
png_warning)(png_structp, png_const_charp warning_msg) {
pnmimage_png_cat.warning()
<< warning_msg << "\n";
}
@ -463,8 +463,8 @@ png_warning(png_structp, png_const_charp warning_msg) {
* This is our own error handler. It is called by the png library to issue a
* fatal error message.
*/
void PNMFileTypePNG::Reader::
png_error(png_structp png_ptr, png_const_charp error_msg) {
void (PNMFileTypePNG::Reader::
png_error)(png_structp png_ptr, png_const_charp error_msg) {
pnmimage_png_cat.error()
<< error_msg << "\n";
@ -923,8 +923,8 @@ png_flush_data(png_structp png_ptr) {
* This is our own warning handler. It is called by the png library to issue
* a warning message.
*/
void PNMFileTypePNG::Writer::
png_warning(png_structp, png_const_charp warning_msg) {
void (PNMFileTypePNG::Writer::
png_warning)(png_structp, png_const_charp warning_msg) {
pnmimage_png_cat.warning()
<< warning_msg << "\n";
}
@ -933,8 +933,8 @@ png_warning(png_structp, png_const_charp warning_msg) {
* This is our own error handler. It is called by the png library to issue a
* fatal error message.
*/
void PNMFileTypePNG::Writer::
png_error(png_structp png_ptr, png_const_charp error_msg) {
void (PNMFileTypePNG::Writer::
png_error)(png_structp png_ptr, png_const_charp error_msg) {
pnmimage_png_cat.error()
<< error_msg << "\n";

View File

@ -58,8 +58,8 @@ public:
static void png_read_data(png_structp png_ptr, png_bytep data,
png_size_t length);
static void png_error(png_structp png_ptr, png_const_charp error_msg);
static void png_warning(png_structp png_ptr, png_const_charp warning_msg);
static void (png_error)(png_structp png_ptr, png_const_charp error_msg);
static void (png_warning)(png_structp png_ptr, png_const_charp warning_msg);
png_structp _png;
png_infop _info;
@ -84,8 +84,8 @@ public:
png_size_t length);
static void png_flush_data(png_structp png_ptr);
static void png_error(png_structp png_ptr, png_const_charp error_msg);
static void png_warning(png_structp png_ptr, png_const_charp warning_msg);
static void (png_error)(png_structp png_ptr, png_const_charp error_msg);
static void (png_warning)(png_structp png_ptr, png_const_charp warning_msg);
png_structp _png;
png_infop _info;