X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6aa89a22b8e47000c98bff05c6f545f331f1c353..764e66945ac93bb6c868265106176ac58c0848a0:/src/mac/carbon/pnghand.cpp diff --git a/src/mac/carbon/pnghand.cpp b/src/mac/carbon/pnghand.cpp index a270cff9e7..bbcfcbec45 100644 --- a/src/mac/carbon/pnghand.cpp +++ b/src/mac/carbon/pnghand.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) # pragma implementation "pngread.h" # pragma implementation "pnghand.h" #endif @@ -21,10 +21,23 @@ # pragma hdrstop #endif +#if 0 // wxUSE_LIBPNG + #include #include #include +#if defined(__DARWIN__) +/* MW's math routines do certain things if __FP__ (the include guard around +CarbonCore's fp.h) is defined. CarbonCore's fp.h does certain things if +__cmath__ is defined so it seems the easy thing to do is to make sure +__cmath__ is effectively not defined which counteracts the MWERKS check +then when the real cmath is included everything will be okay. +*/ +#include +//#include +#endif //defined(__DARWIN__) + #if wxUSE_IOSTREAMH # include #else @@ -57,7 +70,7 @@ extern void wxMacDestroyGWorld( GWorldPtr gw ) ; void ima_png_error(png_struct *png_ptr, char *message) { - wxMessageBox(message, "PNG error"); + wxMessageBox(wxString::FromAscii(message), wxT("PNG error")); longjmp(png_ptr->jmpbuf, 1); } @@ -819,8 +832,9 @@ bool wxPNGReader::SaveXPM(char *filename, char *name) strcpy(nameStr, name); else { - strcpy(nameStr, filename); - wxStripExtension(nameStr); + wxString str = wxString::FromAscii(filename) ; + wxStripExtension( str ) ; + strcpy(nameStr, str.ToAscii() ); } if ( GetDepth() > 4 ) @@ -888,7 +902,7 @@ bool wxPNGFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla int desiredWidth, int desiredHeight) { wxPNGReader reader; - if (reader.ReadFile((char*) (const char*) name)) + if (reader.ReadFile( (char*)(const char*) name.ToAscii() ) ) { return reader.InstantiateBitmap(bitmap); } @@ -901,4 +915,4 @@ bool wxPNGFileHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, in return FALSE; } - +#endif //wxUSE_LIBPNG