X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd938b117780571129a03155ea0dc01fc73b7f23..aa99e0cd2242db04fe1f9bb7d91aea545def2422:/src/common/file.cpp diff --git a/src/common/file.cpp b/src/common/file.cpp index d8f53811f0..cf35fd1486 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -10,11 +10,16 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +/* + TODO: remove all the WinCE ugliness from here, implement the wxOpen(), + wxSeek(), ... functions in a separate file for WinCE instead!!! + */ + // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "file.h" #endif @@ -56,6 +61,8 @@ #elif defined(__WXMSW__) && defined(__WXWINCE__) // TODO: what to include? +#elif (defined(__OS2__)) + #include #elif (defined(__UNIX__) || defined(__GNUWIN32__)) #include #include @@ -73,8 +80,6 @@ #else #error "Please specify the header with file functions declarations." #endif -#elif (defined(__WXPM__)) - #include #elif (defined(__WXSTUBS__)) // Have to ifdef this for different environments #include @@ -140,7 +145,7 @@ #define ACCESS(access) , (access) #endif // Salford C -// wxWindows +// wxWidgets #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/intl.h" @@ -409,10 +414,10 @@ size_t wxFile::Write(const void *pBuf, size_t nCount) wxCHECK( (pBuf != NULL) && IsOpened(), 0 ); #ifdef __WXWINCE__ - DWORD bytesRead = 0; + DWORD bytesWritten = 0; int iRc = 0; - if (WriteFile((HANDLE) m_fd, pBuf, (DWORD) nCount, & bytesRead, NULL)) - iRc = bytesRead; + if (WriteFile((HANDLE) m_fd, pBuf, (DWORD) nCount, & bytesWritten, NULL)) + iRc = bytesWritten; else iRc = -1; #elif defined(__MWERKS__) @@ -692,7 +697,9 @@ bool wxTempFile::Open(const wxString& strName) if ( chmod( (const char*) m_strTemp.fn_str(), mode) == -1 ) { +#ifndef __OS2__ wxLogSysError(_("Failed to set temporary file permissions")); +#endif } #endif // Unix