From b499252a4e6c1dda790edfe3f6afae112fa41640 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 17 Feb 2014 15:12:44 +0000 Subject: [PATCH] Fixed dynamic linking issues with png_get_error_ptr git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4615 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/image.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/client/image.c b/engine/client/image.c index 832a681de..960806cd3 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -719,6 +719,8 @@ png_voidp (PNGAPI *qpng_get_io_ptr) PNGARG((png_structp png_ptr)) PSTATIC(png_ge void (PNGAPI *qpng_destroy_write_struct) PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)) PSTATIC(png_destroy_write_struct); png_structp (PNGAPI *qpng_create_write_struct) PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn)) PSTATIC(png_create_write_struct); +png_voidp (PNGAPI *qpng_get_error_ptr) PNGARG((png_structp png_ptr)) PSTATIC(png_get_error_ptr); + qboolean LibPNG_Init(void) { #ifdef DYNAMIC_LIBPNG @@ -760,6 +762,8 @@ qboolean LibPNG_Init(void) {(void **) &qpng_init_io, "png_init_io"}, {(void **) &qpng_destroy_write_struct, "png_destroy_write_struct"}, {(void **) &qpng_create_write_struct, "png_create_write_struct"}, + + {(void **) &qpng_get_error_ptr, "png_get_error_ptr"}, {NULL, NULL} }; @@ -803,7 +807,7 @@ struct pngerr }; static void VARGS png_onerror(png_structp png_ptr, png_const_charp error_msg) { - struct pngerr *err = png_get_error_ptr(png_ptr); + struct pngerr *err = qpng_get_error_ptr(png_ptr); Con_Printf("libpng %s: %s", err->fname, error_msg); longjmp(err->jbuf, 1); abort(); @@ -811,7 +815,7 @@ static void VARGS png_onerror(png_structp png_ptr, png_const_charp error_msg) static void VARGS png_onwarning(png_structp png_ptr, png_const_charp warning_msg) { - struct pngerr *err = png_get_error_ptr(png_ptr); + struct pngerr *err = qpng_get_error_ptr(png_ptr); Con_Printf("libpng %s: %s\n", err->fname, warning_msg); }