diff --git a/include/wx/strconv.h b/include/wx/strconv.h index cf508681b7..92d5729370 100644 --- a/include/wx/strconv.h +++ b/include/wx/strconv.h @@ -146,7 +146,7 @@ WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent; // ---------------------------------------------------------------------------- // filenames are multibyte on Unix and probably widechar on Windows? -#if defined(__UNIX__) || defined(__WIN32__) +#if defined(__UNIX__) || defined(__BORLANDC__) #define wxMBFILES 1 #else #define wxMBFILES 0 diff --git a/src/common/docview.cpp b/src/common/docview.cpp index e96aaa3e04..3e894aa0d1 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -2199,7 +2199,7 @@ bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream) FILE *fd1; int ch; - if ((fd1 = fopen (filename.fn_str(), "rb")) == NULL) + if ((fd1 = wxFopen (filename.fn_str(), wxT("rb"))) == NULL) return FALSE; while ((ch = getc (fd1)) != EOF) @@ -2214,7 +2214,7 @@ bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename) FILE *fd1; char ch; - if ((fd1 = fopen (filename.fn_str(), "wb")) == NULL) + if ((fd1 = wxFopen (filename.fn_str(), wxT("wb"))) == NULL) { return FALSE; } diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 4a4f4ddfcc..308c2f5246 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1163,7 +1163,7 @@ bool wxPathExists(const wxChar *pszPathName) /* Windows API returns -1 from stat for "c:\dir\" if "c:\dir" exists * OTOH, we should change "d:" to "d:\" and leave "\" as is. */ wxString strPath(pszPathName); - if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != wxT('\0') ) + if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != wxT('\0') && pszPathName[1] != wxT(':') ) strPath.Last() = wxT('\0'); wxStructStat st; diff --git a/src/common/fs_zip.cpp b/src/common/fs_zip.cpp index 8a41c21b6b..706cd05352 100644 --- a/src/common/fs_zip.cpp +++ b/src/common/fs_zip.cpp @@ -118,7 +118,7 @@ wxString wxZipFSHandler::FindFirst(const wxString& spec, int flags) } m_ZipFile = left; - m_Archive = (void*) unzOpen(m_ZipFile.fn_str()); + m_Archive = (void*) unzOpen(m_ZipFile.mb_str()); m_Pattern = right.AfterLast(wxT('/')); m_BaseDir = right.BeforeLast(wxT('/')); diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 946cad0122..902a88a2f2 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -519,7 +519,7 @@ void wxDebugContext::SetStream(ostream *str, streambuf *buf) bool wxDebugContext::SetFile(const wxString& file) { - ofstream *str = new ofstream(file.fn_str()); + ofstream *str = new ofstream(file.mb_str()); if (str->bad()) { @@ -1026,7 +1026,7 @@ void operator delete(void* pData, wxChar* /* fileName */, int /* lineNum */) wxDebugFree(pData, FALSE); } // New operator 21/11/1998 -void operator delete[](void* pData, char* /* fileName */, int /* lineNum */) +void operator delete[](void* pData, wxChar* /* fileName */, int /* lineNum */) { wxDebugFree(pData, TRUE); } diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index 54cb0c8638..c8a864bd72 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -39,13 +39,13 @@ wxZipInputStream::wxZipInputStream(const wxString& archive, const wxString& file m_Pos = 0; m_Size = 0; - m_Archive = (void*) unzOpen(archive.fn_str()); + m_Archive = (void*) unzOpen(archive.mb_str()); if (m_Archive == NULL) { m_lasterror = wxStream_READ_ERR; return; } - if (unzLocateFile((unzFile)m_Archive, file.fn_str(), 0) != UNZ_OK) + if (unzLocateFile((unzFile)m_Archive, file.mb_str(), 0) != UNZ_OK) { m_lasterror = wxStream_READ_ERR; return; diff --git a/src/generic/helphtml.cpp b/src/generic/helphtml.cpp index 8970ba2416..2005af7c14 100644 --- a/src/generic/helphtml.cpp +++ b/src/generic/helphtml.cpp @@ -166,7 +166,7 @@ wxHTMLHelpControllerBase::LoadFile(const wxString& ifile) m_MapList = new wxList; m_NumOfEntries = 0; - FILE *input = fopen(mapFile.fn_str(),"rt"); + FILE *input = wxFopen(mapFile.fn_str(),wxT("rt")); if(! input) return FALSE; do diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index e7c7270724..ce2568c2c2 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -379,12 +379,12 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i p < (WORD *)&pMFHead ->checksum; ++p) pMFHead ->checksum ^= *p; - FILE *fd = fopen(filename.fn_str(), "rb"); + FILE *fd = wxFopen(filename.fn_str(), "rb"); if (!fd) return FALSE; wxChar tempFileBuf[256]; wxGetTempFileName(wxT("mf"), tempFileBuf); - FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb"); + FILE *fHandle = wxFopen(wxConvFile.cWX2MB(tempFileBuf), "wb"); if (!fHandle) return FALSE; fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle);