// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "imagjpeg.h"
#endif
#include "wx/log.h"
#include "wx/app.h"
-// NB: Some compilers define boolean type in Windows headers (e.g. Watcom C++).
+// NB: Some compilers define boolean type in Windows headers
+// (e.g. Watcom C++, but not Open Watcom).
// 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__))
+#if defined(__WXMSW__) && (defined(__MWERKS__) || defined(__DIGITALMARS__) || (defined(__WATCOMC__) && __WATCOMC__ < 1200))
#define HAVE_BOOLEAN
- #include <windows.h>
+ #include "wx/msw/wrapwin.h"
#endif
extern "C"
{
unsigned char hdr[2];
- stream.Read(hdr, 2);
- stream.SeekI(-2, wxFromCurrent);
- return (hdr[0] == 0xFF && hdr[1] == 0xD8);
+ if ( !stream.Read(hdr, WXSIZEOF(hdr)) )
+ return FALSE;
+
+ return hdr[0] == 0xFF && hdr[1] == 0xD8;
}
#endif // wxUSE_STREAMS