X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55d99c7a77789ff4904bf96eddca3715eb5af9b9..56b9925b116dfa58028fccb2556852f2da2ab9ac:/src/common/ffile.cpp diff --git a/src/common/ffile.cpp b/src/common/ffile.cpp index 6b09f9876b..503e5bfa0d 100644 --- a/src/common/ffile.cpp +++ b/src/common/ffile.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "ffile.h" #endif @@ -206,6 +206,9 @@ bool wxFFile::Seek(long ofs, wxSeekMode mode) size_t wxFFile::Tell() const { + wxCHECK_MSG( IsOpened(), (size_t)-1, + _T("wxFFile::Tell(): file is closed!") ); + long rc = ftell(m_fp); if ( rc == -1 ) { @@ -218,6 +221,9 @@ size_t wxFFile::Tell() const size_t wxFFile::Length() const { + wxCHECK_MSG( IsOpened(), (size_t)-1, + _T("wxFFile::Length(): file is closed!") ); + wxFFile& self = *(wxFFile *)this; // const_cast size_t posOld = Tell();