X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8a586e08eef0a5d09612f26f0e0c687cfac9963..1fc0b5afe7813dd301098519e40bfa6e98f328cd:/src/common/file.cpp diff --git a/src/common/file.cpp b/src/common/file.cpp index a4b94e28ca..d72e649bc8 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -335,7 +335,7 @@ size_t wxFile::Write(const void *pBuf, size_t nCount) bool wxFile::Flush() { if ( IsOpened() ) { -#if defined(__VISUALC__) || wxHAVE_FSYNC +#if defined(__VISUALC__) || defined(HAVE_FSYNC) if ( wxFsync(m_fd) == -1 ) { wxLogSysError(_("can't flush file descriptor %d"), m_fd); @@ -356,7 +356,10 @@ bool wxFile::Flush() // 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 ) { @@ -376,11 +379,6 @@ wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode 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 ) {