From 7c1f08b250337e337abddebafcbbecd86d2131bf Mon Sep 17 00:00:00 2001 From: "Ben \"root\" Anderson" Date: Sun, 27 Oct 2013 15:43:16 -0500 Subject: [PATCH] 1) Not _WINDOWS. _MSC_VER. MinGW uses either system libpng or its own extern pulled by autoconf. 2) Note an observed segfault I worked around --- src/RageSurface_Load_PNG.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/RageSurface_Load_PNG.cpp b/src/RageSurface_Load_PNG.cpp index a2f3b9a4ed..69461f38e0 100644 --- a/src/RageSurface_Load_PNG.cpp +++ b/src/RageSurface_Load_PNG.cpp @@ -5,16 +5,15 @@ #include "RageFile.h" #include "RageSurface.h" +#include -#if defined(_WINDOWS) -# include "png.h" -# if defined(_MSC_VER) -# pragma comment(lib, "libpng.lib") -# pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */ -# endif // _MSC_VER +#if defined(_MSC_VER) +#include "../extern/libpng/include/png.h" +#pragma comment(lib, "libpng.lib") +#pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */ #else -# include <../extern/libpng/include/png.h> -#endif +#include +#endif // _MSC_VER namespace { @@ -56,6 +55,7 @@ void PNG_Error( png_struct *png, const char *error ) void PNG_Warning( png_struct *png, const char *warning ) { + // FIXME: Mismatched libpng headers vs. library causes a segfault here on MinGW CHECKPOINT; error_info *info = (error_info *) png_get_io_ptr(png); LOG->Trace( "loading \"%s\": warning: %s", info->fn, warning );