From a3bb1d14a52bddf1855358768b0d1c579c9ff1e3 Mon Sep 17 00:00:00 2001 From: Chris Elliott Date: Mon, 28 Apr 2003 20:58:29 +0000 Subject: [PATCH] SF patch [ 708702 ] Wide character filename support for BCC git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/filefn.h | 13 +++++++++++-- include/wx/msw/mslu.h | 3 ++- src/msw/mslu.cpp | 8 +++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 75313630d8..42bc28cd00 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -78,6 +78,9 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; || ( defined(__MINGW32__) && !defined(__WINE__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \ || ( defined(__MWERKS__) && defined(__WXMSW__) ) // functions +#ifdef __BORLANDC__ + #define _tell tell +#endif #define wxClose _close #define wxRead _read #define wxWrite _write @@ -89,7 +92,11 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; #if wxUSE_UNICODE #if wxUSE_UNICODE_MSLU - #define wxOpen wxMSLU__wopen +#ifdef __BORLANDC__ + #define wxOpen open +#else + #define wxOpen _open +#endif #define wxAccess wxMSLU__waccess #define wxMkDir wxMSLU__wmkdir #define wxRmDir wxMSLU__wrmdir @@ -113,14 +120,16 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; #define wxStructStat struct _stat // constants (unless already defined by the user code) - #ifndef O_RDONLY + #if !defined(O_RDONLY) && !defined(__BORLANDC__) #define O_RDONLY _O_RDONLY #define O_WRONLY _O_WRONLY #define O_RDWR _O_RDWR #define O_EXCL _O_EXCL #define O_CREAT _O_CREAT #define O_BINARY _O_BINARY + #endif + #ifndef __BORLANDC__ #define S_IFMT _S_IFMT #define S_IFDIR _S_IFDIR #define S_IFREG _S_IFREG diff --git a/include/wx/msw/mslu.h b/include/wx/msw/mslu.h index e9ed1ce901..e8700dd40c 100644 --- a/include/wx/msw/mslu.h +++ b/include/wx/msw/mslu.h @@ -58,7 +58,8 @@ WXDLLEXPORT int wxMSLU__tremove(const wxChar *name); #if defined( __VISUALC__ ) \ || ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \ - || ( defined(__MWERKS__) && defined(__WXMSW__) ) + || ( defined(__MWERKS__) && defined(__WXMSW__) ) \ + || ( defined(__BORLANDC__) && (__BORLANDC__ > 0x460) ) WXDLLEXPORT int wxMSLU__wopen(const wxChar *name, int flags, int mode); WXDLLEXPORT int wxMSLU__waccess(const wxChar *name, int mode); WXDLLEXPORT int wxMSLU__wmkdir(const wxChar *name); diff --git a/src/msw/mslu.cpp b/src/msw/mslu.cpp index be480f683f..d4bfce13e5 100644 --- a/src/msw/mslu.cpp +++ b/src/msw/mslu.cpp @@ -18,6 +18,7 @@ #ifdef __BORLANDC__ #pragma hdrstop +#include #endif #ifndef WX_PRECOMP @@ -148,12 +149,17 @@ WXDLLEXPORT int wxMSLU__tremove(const wxChar *name) #if defined( __VISUALC__ ) \ || ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \ - || ( defined(__MWERKS__) && defined(__WXMSW__) ) + || ( defined(__MWERKS__) && defined(__WXMSW__) ) \ + || ( defined(__BORLANDC__) && (__BORLANDC__ > 0x460) ) WXDLLEXPORT int wxMSLU__wopen(const wxChar *name, int flags, int mode) { if ( wxUsingUnicowsDll() ) +#ifdef __BORLANDC__ + return open(wxConvFile.cWX2MB(name), flags, mode); +#else return _open(wxConvFile.cWX2MB(name), flags, mode); +#endif else return _wopen(name, flags, mode); } -- 2.45.2