X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/717510eb58c5c58f0ae9dabf1f4279d91109a4e7..ab5fe83396c13f9fbf01630c52adf4df7607cbfe:/src/common/imagjpeg.cpp?ds=sidebyside diff --git a/src/common/imagjpeg.cpp b/src/common/imagjpeg.cpp index 58ee909282..2f5cd0a432 100644 --- a/src/common/imagjpeg.cpp +++ b/src/common/imagjpeg.cpp @@ -27,10 +27,21 @@ #include "wx/debug.h" #include "wx/log.h" #include "wx/app.h" + +// NB: Some compilers define boolean type in Windows headers (e.g. Watcom C++). +// This causes a conflict with jmorecfg.h header from libjpeg, so we have +// to make sure libjpeg won't try to define boolean itself. This is done by +// defining HAVE_BOOLEAN. +#if defined(__WXMSW__) && (defined(__MWERKS__) || defined(__WATCOMC__)) + #define HAVE_BOOLEAN + #include +#endif + extern "C" { #include "jpeglib.h" } + #include "wx/filefn.h" #include "wx/wfstream.h" #include "wx/intl.h" @@ -47,10 +58,6 @@ extern "C" #endif #endif -#ifdef __WXMSW__ -#include -#endif - //----------------------------------------------------------------------------- // wxJPEGHandler //----------------------------------------------------------------------------- @@ -197,7 +204,7 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos */ if (verbose) wxLogError(_("JPEG: Couldn't load - file is probably corrupted.")); - (cinfo.src->term_source) (&cinfo);; + (cinfo.src->term_source)(&cinfo); jpeg_destroy_decompress(&cinfo); if (image->Ok()) image->Destroy(); return FALSE;