Enable the huge files patch to build with mingw-cross.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
6ea3ac58ea
commit
4004775e5a
@ -183,6 +183,8 @@ enum wxSeekMode
|
||||
|
||||
// Not all of the Win32 compilers do have huge file support, for example
|
||||
// the Digitalmars compiler does not have huge file size support
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
#undef __HUGEFILES_SUPPORTED
|
||||
#if _INTEGRAL_MAX_BITS >= 64 && !defined(__DMC__)
|
||||
#define __HUGEFILES_SUPPORTED 1
|
||||
@ -199,7 +201,7 @@ enum wxSeekMode
|
||||
typedef wxLongLong_t wxFileOffset;
|
||||
#define wxFileOffsetFmtSpec wxLongLongFmtSpec
|
||||
#else
|
||||
typedef int wxFileOffset;
|
||||
typedef off_t wxFileOffset;
|
||||
#define wxFileOffsetFmtSpec _("")
|
||||
#endif
|
||||
|
||||
|
@ -35,8 +35,8 @@ protected:
|
||||
wxStreamBuffer *m_i_streambuf;
|
||||
|
||||
size_t OnSysRead(void *buffer, size_t nbytes);
|
||||
off_t OnSysSeek(off_t pos, wxSeekMode mode);
|
||||
off_t OnSysTell() const;
|
||||
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
|
||||
wxFileOffset OnSysTell() const;
|
||||
|
||||
private:
|
||||
size_t m_length;
|
||||
@ -64,8 +64,8 @@ protected:
|
||||
|
||||
protected:
|
||||
size_t OnSysWrite(const void *buffer, size_t nbytes);
|
||||
off_t OnSysSeek(off_t pos, wxSeekMode mode);
|
||||
off_t OnSysTell() const;
|
||||
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
|
||||
wxFileOffset OnSysTell() const;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxMemoryOutputStream)
|
||||
};
|
||||
|
@ -27,9 +27,9 @@ class WXDLLIMPEXP_NET wxSocketOutputStream : public wxOutputStream
|
||||
wxSocketOutputStream(wxSocketBase& s);
|
||||
~wxSocketOutputStream();
|
||||
|
||||
off_t SeekO( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) )
|
||||
wxFileOffset SeekO( wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode) )
|
||||
{ return -1; }
|
||||
off_t TellO() const
|
||||
wxFileOffset TellO() const
|
||||
{ return -1; }
|
||||
|
||||
protected:
|
||||
@ -46,9 +46,9 @@ class WXDLLIMPEXP_NET wxSocketInputStream : public wxInputStream
|
||||
wxSocketInputStream(wxSocketBase& s);
|
||||
~wxSocketInputStream();
|
||||
|
||||
off_t SeekI( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) )
|
||||
wxFileOffset SeekI( wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode) )
|
||||
{ return -1; }
|
||||
off_t TellI() const
|
||||
wxFileOffset TellI() const
|
||||
{ return -1; }
|
||||
|
||||
protected:
|
||||
|
@ -34,8 +34,8 @@ public:
|
||||
virtual size_t GetSize() const { return m_str.length(); }
|
||||
|
||||
protected:
|
||||
virtual off_t OnSysSeek(off_t ofs, wxSeekMode mode);
|
||||
virtual off_t OnSysTell() const;
|
||||
virtual wxFileOffset OnSysSeek(wxFileOffset ofs, wxSeekMode mode);
|
||||
virtual wxFileOffset OnSysTell() const;
|
||||
virtual size_t OnSysRead(void *buffer, size_t size);
|
||||
|
||||
private:
|
||||
@ -68,7 +68,7 @@ public:
|
||||
const wxString& GetString() const { return *m_str; }
|
||||
|
||||
protected:
|
||||
virtual off_t OnSysTell() const;
|
||||
virtual wxFileOffset OnSysTell() const;
|
||||
virtual size_t OnSysWrite(const void *buffer, size_t size);
|
||||
|
||||
private:
|
||||
|
@ -91,8 +91,8 @@ public:
|
||||
#endif // WXWIN_COMPATIBILITY_2_2
|
||||
|
||||
protected:
|
||||
virtual off_t OnSysSeek(off_t seek, wxSeekMode mode);
|
||||
virtual off_t OnSysTell() const;
|
||||
virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
|
||||
virtual wxFileOffset OnSysTell() const;
|
||||
|
||||
size_t m_lastcount;
|
||||
wxStreamError m_lasterror;
|
||||
@ -192,10 +192,10 @@ public:
|
||||
// it)
|
||||
//
|
||||
// returns wxInvalidOffset on error
|
||||
virtual off_t SeekI(off_t pos, wxSeekMode mode = wxFromStart);
|
||||
virtual wxFileOffset SeekI(wxFileOffset pos, wxSeekMode mode = wxFromStart);
|
||||
|
||||
// return the current position of the stream pointer or wxInvalidOffset
|
||||
virtual off_t TellI() const;
|
||||
virtual wxFileOffset TellI() const;
|
||||
|
||||
|
||||
// stream-like operators
|
||||
@ -250,8 +250,8 @@ public:
|
||||
virtual wxOutputStream& Write(const void *buffer, size_t size);
|
||||
wxOutputStream& Write(wxInputStream& stream_in);
|
||||
|
||||
virtual off_t SeekO(off_t pos, wxSeekMode mode = wxFromStart);
|
||||
virtual off_t TellO() const;
|
||||
virtual wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart);
|
||||
virtual wxFileOffset TellO() const;
|
||||
|
||||
virtual size_t LastWrite() const { return wxStreamBase::m_lastcount; }
|
||||
|
||||
@ -288,8 +288,8 @@ public:
|
||||
|
||||
protected:
|
||||
virtual size_t OnSysWrite(const void *buffer, size_t size);
|
||||
virtual off_t OnSysSeek(off_t pos, wxSeekMode mode);
|
||||
virtual off_t OnSysTell() const;
|
||||
virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
|
||||
virtual wxFileOffset OnSysTell() const;
|
||||
|
||||
size_t m_currentPos;
|
||||
|
||||
@ -368,8 +368,8 @@ public:
|
||||
virtual char Peek();
|
||||
virtual char GetChar();
|
||||
virtual void PutChar(char c);
|
||||
virtual off_t Tell() const;
|
||||
virtual off_t Seek(off_t pos, wxSeekMode mode);
|
||||
virtual wxFileOffset Tell() const;
|
||||
virtual wxFileOffset Seek(wxFileOffset pos, wxSeekMode mode);
|
||||
|
||||
// Buffer control
|
||||
void ResetBuffer();
|
||||
@ -475,8 +475,8 @@ public:
|
||||
wxInputStream& Read(void *buffer, size_t size);
|
||||
|
||||
// Position functions
|
||||
off_t SeekI(off_t pos, wxSeekMode mode = wxFromStart);
|
||||
off_t TellI() const;
|
||||
wxFileOffset SeekI(wxFileOffset pos, wxSeekMode mode = wxFromStart);
|
||||
wxFileOffset TellI() const;
|
||||
|
||||
// the buffer given to the stream will be deleted by it
|
||||
void SetInputStreamBuffer(wxStreamBuffer *buffer);
|
||||
@ -487,8 +487,8 @@ public:
|
||||
|
||||
protected:
|
||||
virtual size_t OnSysRead(void *buffer, size_t bufsize);
|
||||
virtual off_t OnSysSeek(off_t seek, wxSeekMode mode);
|
||||
virtual off_t OnSysTell() const;
|
||||
virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
|
||||
virtual wxFileOffset OnSysTell() const;
|
||||
|
||||
wxStreamBuffer *m_i_streambuf;
|
||||
|
||||
@ -510,8 +510,8 @@ public:
|
||||
wxOutputStream& Write(const void *buffer, size_t size);
|
||||
|
||||
// Position functions
|
||||
off_t SeekO(off_t pos, wxSeekMode mode = wxFromStart);
|
||||
off_t TellO() const;
|
||||
wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart);
|
||||
wxFileOffset TellO() const;
|
||||
|
||||
void Sync();
|
||||
|
||||
@ -526,8 +526,8 @@ public:
|
||||
|
||||
protected:
|
||||
virtual size_t OnSysWrite(const void *buffer, size_t bufsize);
|
||||
virtual off_t OnSysSeek(off_t seek, wxSeekMode mode);
|
||||
virtual off_t OnSysTell() const;
|
||||
virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
|
||||
virtual wxFileOffset OnSysTell() const;
|
||||
|
||||
wxStreamBuffer *m_o_streambuf;
|
||||
|
||||
|
@ -45,8 +45,8 @@ class WXDLLIMPEXP_BASE wxFileInputStream: public wxInputStream {
|
||||
wxFileInputStream();
|
||||
|
||||
size_t OnSysRead(void *buffer, size_t size);
|
||||
off_t OnSysSeek(off_t pos, wxSeekMode mode);
|
||||
off_t OnSysTell() const;
|
||||
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
|
||||
wxFileOffset OnSysTell() const;
|
||||
|
||||
protected:
|
||||
wxFile *m_file;
|
||||
@ -75,8 +75,8 @@ class WXDLLIMPEXP_BASE wxFileOutputStream: public wxOutputStream {
|
||||
wxFileOutputStream();
|
||||
|
||||
size_t OnSysWrite(const void *buffer, size_t size);
|
||||
off_t OnSysSeek(off_t pos, wxSeekMode mode);
|
||||
off_t OnSysTell() const;
|
||||
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
|
||||
wxFileOffset OnSysTell() const;
|
||||
|
||||
protected:
|
||||
wxFile *m_file;
|
||||
@ -114,8 +114,8 @@ class WXDLLIMPEXP_BASE wxFFileInputStream: public wxInputStream {
|
||||
wxFFileInputStream();
|
||||
|
||||
size_t OnSysRead(void *buffer, size_t size);
|
||||
off_t OnSysSeek(off_t pos, wxSeekMode mode);
|
||||
off_t OnSysTell() const;
|
||||
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
|
||||
wxFileOffset OnSysTell() const;
|
||||
|
||||
protected:
|
||||
wxFFile *m_file;
|
||||
@ -144,8 +144,8 @@ class WXDLLIMPEXP_BASE wxFFileOutputStream: public wxOutputStream {
|
||||
wxFFileOutputStream();
|
||||
|
||||
size_t OnSysWrite(const void *buffer, size_t size);
|
||||
off_t OnSysSeek(off_t pos, wxSeekMode mode);
|
||||
off_t OnSysTell() const;
|
||||
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode);
|
||||
wxFileOffset OnSysTell() const;
|
||||
|
||||
protected:
|
||||
wxFFile *m_file;
|
||||
|
@ -39,12 +39,12 @@ public:
|
||||
|
||||
protected:
|
||||
virtual size_t OnSysRead(void *buffer, size_t bufsize);
|
||||
virtual off_t OnSysSeek(off_t seek, wxSeekMode mode);
|
||||
virtual off_t OnSysTell() const {return m_Pos;}
|
||||
virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
|
||||
virtual wxFileOffset OnSysTell() const {return m_Pos;}
|
||||
|
||||
private:
|
||||
size_t m_Size;
|
||||
off_t m_Pos;
|
||||
wxFileOffset m_Pos;
|
||||
|
||||
// this void* is handle of archive . I'm sorry it is void and not proper
|
||||
// type but I don't want to make unzip.h header public.
|
||||
|
@ -52,13 +52,13 @@ class WXDLLIMPEXP_BASE wxZlibInputStream: public wxFilterInputStream {
|
||||
|
||||
protected:
|
||||
size_t OnSysRead(void *buffer, size_t size);
|
||||
off_t OnSysTell() const { return m_pos; }
|
||||
wxFileOffset OnSysTell() const { return m_pos; }
|
||||
|
||||
protected:
|
||||
size_t m_z_size;
|
||||
unsigned char *m_z_buffer;
|
||||
struct z_stream_s *m_inflate;
|
||||
off_t m_pos;
|
||||
wxFileOffset m_pos;
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
bool m_24compatibilty;
|
||||
#endif
|
||||
@ -78,7 +78,7 @@ class WXDLLIMPEXP_BASE wxZlibOutputStream: public wxFilterOutputStream {
|
||||
|
||||
protected:
|
||||
size_t OnSysWrite(const void *buffer, size_t size);
|
||||
off_t OnSysTell() const { return m_pos; }
|
||||
wxFileOffset OnSysTell() const { return m_pos; }
|
||||
|
||||
virtual void DoFlush(bool final);
|
||||
|
||||
@ -86,7 +86,7 @@ class WXDLLIMPEXP_BASE wxZlibOutputStream: public wxFilterOutputStream {
|
||||
size_t m_z_size;
|
||||
unsigned char *m_z_buffer;
|
||||
struct z_stream_s *m_deflate;
|
||||
off_t m_pos;
|
||||
wxFileOffset m_pos;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxZlibOutputStream)
|
||||
};
|
||||
|
@ -85,12 +85,12 @@ size_t wxMemoryInputStream::OnSysRead(void *buffer, size_t nbytes)
|
||||
return m_i_streambuf->GetIntPosition() - pos;
|
||||
}
|
||||
|
||||
off_t wxMemoryInputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxMemoryInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
return m_i_streambuf->Seek(pos, mode);
|
||||
}
|
||||
|
||||
off_t wxMemoryInputStream::OnSysTell() const
|
||||
wxFileOffset wxMemoryInputStream::OnSysTell() const
|
||||
{
|
||||
return m_i_streambuf->Tell();
|
||||
}
|
||||
@ -126,12 +126,12 @@ size_t wxMemoryOutputStream::OnSysWrite(const void *buffer, size_t nbytes)
|
||||
return newpos - oldpos;
|
||||
}
|
||||
|
||||
off_t wxMemoryOutputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxMemoryOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
return m_o_streambuf->Seek(pos, mode);
|
||||
}
|
||||
|
||||
off_t wxMemoryOutputStream::OnSysTell() const
|
||||
wxFileOffset wxMemoryOutputStream::OnSysTell() const
|
||||
{
|
||||
return m_o_streambuf->Tell();
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
// seek/tell
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
off_t wxStringInputStream::OnSysSeek(off_t ofs, wxSeekMode mode)
|
||||
wxFileOffset wxStringInputStream::OnSysSeek(wxFileOffset ofs, wxSeekMode mode)
|
||||
{
|
||||
const size_t ofsMax = m_str.length()*sizeof(wxChar);
|
||||
|
||||
@ -67,9 +67,9 @@ off_t wxStringInputStream::OnSysSeek(off_t ofs, wxSeekMode mode)
|
||||
return ofs;
|
||||
}
|
||||
|
||||
off_t wxStringInputStream::OnSysTell() const
|
||||
wxFileOffset wxStringInputStream::OnSysTell() const
|
||||
{
|
||||
return wx_static_cast(off_t, m_pos);
|
||||
return wx_static_cast(wxFileOffset, m_pos);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -105,9 +105,9 @@ size_t wxStringInputStream::OnSysRead(void *buffer, size_t size)
|
||||
// seek/tell
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
off_t wxStringOutputStream::OnSysTell() const
|
||||
wxFileOffset wxStringOutputStream::OnSysTell() const
|
||||
{
|
||||
return wx_static_cast(off_t, m_pos);
|
||||
return wx_static_cast(wxFileOffset, m_pos);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -551,11 +551,11 @@ size_t wxStreamBuffer::Write(wxStreamBuffer *sbuf)
|
||||
return total;
|
||||
}
|
||||
|
||||
off_t wxStreamBuffer::Seek(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxStreamBuffer::Seek(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
off_t ret_off, diff;
|
||||
wxFileOffset ret_off, diff;
|
||||
|
||||
off_t last_access = GetLastAccess();
|
||||
wxFileOffset last_access = GetLastAccess();
|
||||
|
||||
if ( !m_flushable )
|
||||
{
|
||||
@ -619,9 +619,9 @@ off_t wxStreamBuffer::Seek(off_t pos, wxSeekMode mode)
|
||||
return wxInvalidOffset;
|
||||
}
|
||||
|
||||
off_t wxStreamBuffer::Tell() const
|
||||
wxFileOffset wxStreamBuffer::Tell() const
|
||||
{
|
||||
off_t pos;
|
||||
wxFileOffset pos;
|
||||
|
||||
// ask the stream for position if we have a real one
|
||||
if ( m_stream )
|
||||
@ -657,12 +657,12 @@ wxStreamBase::~wxStreamBase()
|
||||
{
|
||||
}
|
||||
|
||||
off_t wxStreamBase::OnSysSeek(off_t WXUNUSED(seek), wxSeekMode WXUNUSED(mode))
|
||||
wxFileOffset wxStreamBase::OnSysSeek(wxFileOffset WXUNUSED(seek), wxSeekMode WXUNUSED(mode))
|
||||
{
|
||||
return wxInvalidOffset;
|
||||
}
|
||||
|
||||
off_t wxStreamBase::OnSysTell() const
|
||||
wxFileOffset wxStreamBase::OnSysTell() const
|
||||
{
|
||||
return wxInvalidOffset;
|
||||
}
|
||||
@ -853,7 +853,7 @@ wxInputStream& wxInputStream::Read(wxOutputStream& stream_out)
|
||||
return *this;
|
||||
}
|
||||
|
||||
off_t wxInputStream::SeekI(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxInputStream::SeekI(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
// RR: This code is duplicated in wxBufferedInputStream. This is
|
||||
// not really a good design, but buffered stream are different
|
||||
@ -887,9 +887,9 @@ off_t wxInputStream::SeekI(off_t pos, wxSeekMode mode)
|
||||
return OnSysSeek(pos, mode);
|
||||
}
|
||||
|
||||
off_t wxInputStream::TellI() const
|
||||
wxFileOffset wxInputStream::TellI() const
|
||||
{
|
||||
off_t pos = OnSysTell();
|
||||
wxFileOffset pos = OnSysTell();
|
||||
|
||||
if (pos != wxInvalidOffset)
|
||||
pos -= (m_wbacksize - m_wbackcur);
|
||||
@ -933,12 +933,12 @@ wxOutputStream& wxOutputStream::Write(wxInputStream& stream_in)
|
||||
return *this;
|
||||
}
|
||||
|
||||
off_t wxOutputStream::TellO() const
|
||||
wxFileOffset wxOutputStream::TellO() const
|
||||
{
|
||||
return OnSysTell();
|
||||
}
|
||||
|
||||
off_t wxOutputStream::SeekO(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxOutputStream::SeekO(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
return OnSysSeek(pos, mode);
|
||||
}
|
||||
@ -972,7 +972,7 @@ size_t wxCountingOutputStream::OnSysWrite(const void *WXUNUSED(buffer),
|
||||
return m_currentPos;
|
||||
}
|
||||
|
||||
off_t wxCountingOutputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxCountingOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
switch ( mode )
|
||||
{
|
||||
@ -999,7 +999,7 @@ off_t wxCountingOutputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
return m_currentPos;
|
||||
}
|
||||
|
||||
off_t wxCountingOutputStream::OnSysTell() const
|
||||
wxFileOffset wxCountingOutputStream::OnSysTell() const
|
||||
{
|
||||
return m_currentPos;
|
||||
}
|
||||
@ -1063,7 +1063,7 @@ wxBufferedInputStream::wxBufferedInputStream(wxInputStream& s,
|
||||
|
||||
wxBufferedInputStream::~wxBufferedInputStream()
|
||||
{
|
||||
m_parent_i_stream->SeekI(-(off_t)m_i_streambuf->GetBytesLeft(),
|
||||
m_parent_i_stream->SeekI(-(wxFileOffset)m_i_streambuf->GetBytesLeft(),
|
||||
wxFromCurrent);
|
||||
|
||||
delete m_i_streambuf;
|
||||
@ -1100,7 +1100,7 @@ wxInputStream& wxBufferedInputStream::Read(void *buf, size_t size)
|
||||
return *this;
|
||||
}
|
||||
|
||||
off_t wxBufferedInputStream::SeekI(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxBufferedInputStream::SeekI(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
// RR: Look at wxInputStream for comments.
|
||||
|
||||
@ -1120,9 +1120,9 @@ off_t wxBufferedInputStream::SeekI(off_t pos, wxSeekMode mode)
|
||||
return m_i_streambuf->Seek(pos, mode);
|
||||
}
|
||||
|
||||
off_t wxBufferedInputStream::TellI() const
|
||||
wxFileOffset wxBufferedInputStream::TellI() const
|
||||
{
|
||||
off_t pos = m_i_streambuf->Tell();
|
||||
wxFileOffset pos = m_i_streambuf->Tell();
|
||||
|
||||
if (pos != wxInvalidOffset)
|
||||
pos -= (m_wbacksize - m_wbackcur);
|
||||
@ -1135,12 +1135,12 @@ size_t wxBufferedInputStream::OnSysRead(void *buffer, size_t bufsize)
|
||||
return m_parent_i_stream->Read(buffer, bufsize).LastRead();
|
||||
}
|
||||
|
||||
off_t wxBufferedInputStream::OnSysSeek(off_t seek, wxSeekMode mode)
|
||||
wxFileOffset wxBufferedInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode)
|
||||
{
|
||||
return m_parent_i_stream->SeekI(seek, mode);
|
||||
}
|
||||
|
||||
off_t wxBufferedInputStream::OnSysTell() const
|
||||
wxFileOffset wxBufferedInputStream::OnSysTell() const
|
||||
{
|
||||
return m_parent_i_stream->TellI();
|
||||
}
|
||||
@ -1186,13 +1186,13 @@ wxOutputStream& wxBufferedOutputStream::Write(const void *buffer, size_t size)
|
||||
return *this;
|
||||
}
|
||||
|
||||
off_t wxBufferedOutputStream::SeekO(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxBufferedOutputStream::SeekO(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
Sync();
|
||||
return m_o_streambuf->Seek(pos, mode);
|
||||
}
|
||||
|
||||
off_t wxBufferedOutputStream::TellO() const
|
||||
wxFileOffset wxBufferedOutputStream::TellO() const
|
||||
{
|
||||
return m_o_streambuf->Tell();
|
||||
}
|
||||
@ -1208,12 +1208,12 @@ size_t wxBufferedOutputStream::OnSysWrite(const void *buffer, size_t bufsize)
|
||||
return m_parent_o_stream->Write(buffer, bufsize).LastWrite();
|
||||
}
|
||||
|
||||
off_t wxBufferedOutputStream::OnSysSeek(off_t seek, wxSeekMode mode)
|
||||
wxFileOffset wxBufferedOutputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode)
|
||||
{
|
||||
return m_parent_o_stream->SeekO(seek, mode);
|
||||
}
|
||||
|
||||
off_t wxBufferedOutputStream::OnSysTell() const
|
||||
wxFileOffset wxBufferedOutputStream::OnSysTell() const
|
||||
{
|
||||
return m_parent_o_stream->TellO();
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ size_t wxFileInputStream::GetSize() const
|
||||
|
||||
size_t wxFileInputStream::OnSysRead(void *buffer, size_t size)
|
||||
{
|
||||
off_t ret = m_file->Read(buffer, size);
|
||||
wxFileOffset ret = m_file->Read(buffer, size);
|
||||
|
||||
// NB: we can't use a switch here because HP-UX CC doesn't allow
|
||||
// switching over long long (which off_t is in 64bit mode)
|
||||
@ -93,12 +93,12 @@ size_t wxFileInputStream::OnSysRead(void *buffer, size_t size)
|
||||
return ret;
|
||||
}
|
||||
|
||||
off_t wxFileInputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxFileInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
return m_file->Seek(pos, mode);
|
||||
}
|
||||
|
||||
off_t wxFileInputStream::OnSysTell() const
|
||||
wxFileOffset wxFileInputStream::OnSysTell() const
|
||||
{
|
||||
return m_file->Tell();
|
||||
}
|
||||
@ -160,12 +160,12 @@ size_t wxFileOutputStream::OnSysWrite(const void *buffer, size_t size)
|
||||
return ret;
|
||||
}
|
||||
|
||||
off_t wxFileOutputStream::OnSysTell() const
|
||||
wxFileOffset wxFileOutputStream::OnSysTell() const
|
||||
{
|
||||
return m_file->Tell();
|
||||
}
|
||||
|
||||
off_t wxFileOutputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxFileOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
return m_file->Seek(pos, mode);
|
||||
}
|
||||
@ -234,7 +234,7 @@ size_t wxFFileInputStream::GetSize() const
|
||||
|
||||
size_t wxFFileInputStream::OnSysRead(void *buffer, size_t size)
|
||||
{
|
||||
off_t ret;
|
||||
wxFileOffset ret;
|
||||
|
||||
ret = m_file->Read(buffer, size);
|
||||
|
||||
@ -249,7 +249,7 @@ size_t wxFFileInputStream::OnSysRead(void *buffer, size_t size)
|
||||
return ret;
|
||||
}
|
||||
|
||||
off_t wxFFileInputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxFFileInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
#ifdef __VMS
|
||||
#pragma message disable intsignchange
|
||||
@ -260,7 +260,7 @@ off_t wxFFileInputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
#endif
|
||||
}
|
||||
|
||||
off_t wxFFileInputStream::OnSysTell() const
|
||||
wxFileOffset wxFFileInputStream::OnSysTell() const
|
||||
{
|
||||
return m_file->Tell();
|
||||
}
|
||||
@ -323,12 +323,12 @@ size_t wxFFileOutputStream::OnSysWrite(const void *buffer, size_t size)
|
||||
return ret;
|
||||
}
|
||||
|
||||
off_t wxFFileOutputStream::OnSysTell() const
|
||||
wxFileOffset wxFFileOutputStream::OnSysTell() const
|
||||
{
|
||||
return m_file->Tell();
|
||||
}
|
||||
|
||||
off_t wxFFileOutputStream::OnSysSeek(off_t pos, wxSeekMode mode)
|
||||
wxFileOffset wxFFileOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
|
||||
{
|
||||
#ifdef __VMS
|
||||
#pragma message disable intsignchange
|
||||
|
@ -77,19 +77,19 @@ wxZipInputStream::~wxZipInputStream()
|
||||
|
||||
bool wxZipInputStream::Eof() const
|
||||
{
|
||||
wxASSERT_MSG( m_Pos <= (off_t)m_Size,
|
||||
wxASSERT_MSG( m_Pos <= (wxFileOffset)m_Size,
|
||||
_T("wxZipInputStream: invalid current position") );
|
||||
|
||||
return m_Pos >= (off_t)m_Size;
|
||||
return m_Pos >= (wxFileOffset)m_Size;
|
||||
}
|
||||
|
||||
|
||||
size_t wxZipInputStream::OnSysRead(void *buffer, size_t bufsize)
|
||||
{
|
||||
wxASSERT_MSG( m_Pos <= (off_t)m_Size,
|
||||
wxASSERT_MSG( m_Pos <= (wxFileOffset)m_Size,
|
||||
_T("wxZipInputStream: invalid current position") );
|
||||
|
||||
if ( m_Pos >= (off_t)m_Size )
|
||||
if ( m_Pos >= (wxFileOffset)m_Size )
|
||||
{
|
||||
m_lasterror = wxSTREAM_EOF;
|
||||
return 0;
|
||||
@ -106,14 +106,14 @@ size_t wxZipInputStream::OnSysRead(void *buffer, size_t bufsize)
|
||||
|
||||
|
||||
|
||||
off_t wxZipInputStream::OnSysSeek(off_t seek, wxSeekMode mode)
|
||||
wxFileOffset wxZipInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode)
|
||||
{
|
||||
// NB: since ZIP files don't natively support seeking, we have to
|
||||
// implement a brute force workaround -- reading all the data
|
||||
// between current and the new position (or between beginning of
|
||||
// the file and new position...)
|
||||
|
||||
off_t nextpos;
|
||||
wxFileOffset nextpos;
|
||||
|
||||
switch ( mode )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user