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

This commit is contained in:
Ben "root" Anderson
2013-10-27 15:43:16 -05:00
parent 3b9d8a9994
commit 7c1f08b250
+8 -8
View File
@@ -5,16 +5,15 @@
#include "RageFile.h" #include "RageFile.h"
#include "RageSurface.h" #include "RageSurface.h"
#include <png.h>
#if defined(_WINDOWS) #if defined(_MSC_VER)
# include "png.h" #include "../extern/libpng/include/png.h"
# if defined(_MSC_VER) #pragma comment(lib, "libpng.lib")
# pragma comment(lib, "libpng.lib") #pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */
# pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */
# endif // _MSC_VER
#else #else
# include <../extern/libpng/include/png.h> #include <png.h>
#endif #endif // _MSC_VER
namespace namespace
{ {
@@ -56,6 +55,7 @@ void PNG_Error( png_struct *png, const char *error )
void PNG_Warning( png_struct *png, const char *warning ) void PNG_Warning( png_struct *png, const char *warning )
{ {
// FIXME: Mismatched libpng headers vs. library causes a segfault here on MinGW
CHECKPOINT; CHECKPOINT;
error_info *info = (error_info *) png_get_io_ptr(png); error_info *info = (error_info *) png_get_io_ptr(png);
LOG->Trace( "loading \"%s\": warning: %s", info->fn, warning ); LOG->Trace( "loading \"%s\": warning: %s", info->fn, warning );