X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abffc1ff5d6546356804b0c2c6805a655c28104b..48a1108eb87970373e1b1d5debeeaedd8d1916ea:/src/common/zstream.cpp?ds=sidebyside diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp index 684ff82cfd..55589614a5 100644 --- a/src/common/zstream.cpp +++ b/src/common/zstream.cpp @@ -1,5 +1,5 @@ ////////////////////////////////////////////////////////////////////////////// -// Name: zstream.cpp +// Name: src/common/zstream.cpp // Purpose: Compressed stream classes // Author: Guilhem Lavaux // Modified by: Mike Wetherell @@ -13,24 +13,28 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif #if wxUSE_ZLIB && wxUSE_STREAMS #include "wx/zstream.h" -#include "wx/utils.h" -#include "wx/intl.h" -#include "wx/log.h" + +#ifndef WX_PRECOMP + #include "wx/intl.h" + #include "wx/log.h" + #include "wx/utils.h" +#endif + // normally, the compiler options should contain -I../zlib, but it is // apparently not the case for all MSW makefiles and so, unless we use // configure (which defines __WX_SETUP_H__) or it is explicitly overridden by // the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here #if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH) - #include "../zlib/zlib.h" + #include "../zlib/zlib.h" #else - #include "zlib.h" + #include "zlib.h" #endif enum { @@ -283,7 +287,11 @@ size_t wxZlibOutputStream::OnSysWrite(const void *buffer, size_t size) wxASSERT_MSG(m_deflate && m_z_buffer, wxT("Deflate stream not open")); if (!m_deflate || !m_z_buffer) + { + // notice that this will make IsOk() test just below return false m_lasterror = wxSTREAM_WRITE_ERROR; + } + if (!IsOk() || !size) return 0; @@ -327,4 +335,3 @@ size_t wxZlibOutputStream::OnSysWrite(const void *buffer, size_t size) #endif // wxUSE_ZLIB && wxUSE_STREAMS -