#include "wx/msw/private.h"
#endif
-#if !defined __UNIX__ && !defined __DJGPP__
- #ifdef __WXWINCE__
- typedef int ssize_t;
- #else
- typedef ptrdiff_t ssize_t;
- #endif
-#endif
-wxCOMPILE_TIME_ASSERT(sizeof(ssize_t) == sizeof(size_t), ssize_t_wrong_size);
// ============================================================================
// implementation of wxFile
// ----------------------------------------------------------------------------
// read
-size_t wxFile::Read(void *pBuf, size_t nCount)
+ssize_t wxFile::Read(void *pBuf, size_t nCount)
{
wxCHECK( (pBuf != NULL) && IsOpened(), 0 );
if ( iRc == -1 )
{
wxLogSysError(_("can't read from file descriptor %d"), m_fd);
- return (size_t)wxInvalidOffset;
+ return wxInvalidOffset;
}
return iRc;
// seek
wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode)
{
- wxASSERT( IsOpened() );
+ wxASSERT_MSG( IsOpened(), _T("can't seek on closed file") );
+ wxCHECK_MSG( ofs != wxInvalidOffset || mode != wxFromStart,
+ wxInvalidOffset,
+ _T("invalid absolute file offset") );
int origin;
switch ( mode ) {
break;
}
- if (ofs == wxInvalidOffset)
- {
- wxLogSysError(_("can't seek on file descriptor %d, large files support is not enabled."), m_fd);
- return wxInvalidOffset;
- }
wxFileOffset iRc = wxSeek(m_fd, ofs, origin);
if ( iRc == wxInvalidOffset )
{