X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f49ad976f42dea6430eefb6e70479afd44295909..210bb741b94a7a4a015de730017c3576afe7a8f1:/include/wx/filefn.h diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 248bee7fcf..466adfaa7d 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -204,6 +204,13 @@ enum wxFileKind #define wxHAS_UNDERSCORES_IN_POSIX_IDENTS #endif + // at least Borland 5.5 doesn't like "struct ::stat" so don't use the scope + // resolution operator present in wxPOSIX_IDENT for it + #ifdef __BORLANDC__ + #define wxPOSIX_STRUCT(s) struct s + #else + #define wxPOSIX_STRUCT(s) struct wxPOSIX_IDENT(s) + #endif // first functions not working with strings, i.e. without ANSI/Unicode // complications @@ -235,10 +242,12 @@ enum wxFileKind #endif // wxHAS_HUGE_FILES/!wxHAS_HUGE_FILES #ifndef __WATCOMC__ - // NB: this one is not POSIX and always has the underscore - #define wxFsync _commit + #if !defined(__BORLANDC__) || (__BORLANDC__ > 0x540) + // NB: this one is not POSIX and always has the underscore + #define wxFsync _commit - #define HAVE_FSYNC + #define HAVE_FSYNC + #endif // BORLANDC #endif #define wxEof wxPOSIX_IDENT(eof) @@ -261,11 +270,10 @@ enum wxFileKind WXDLLIMPEXP_BASE int wxMSLU__wrmdir(const wxChar *name); WXDLLIMPEXP_BASE int - wxMSLU__wstat(const wxChar *name, - struct wxPOSIX_IDENT(stat) *buffer); + wxMSLU__wstat(const wxChar *name, wxPOSIX_STRUCT(stat) *buffer); WXDLLIMPEXP_BASE int wxMSLU__wstati64(const wxChar *name, - struct wxPOSIX_IDENT(stati64) *buffer); + wxPOSIX_STRUCT(stati64) *buffer); #endif // Windows compilers with MSLU support #define wxOpen wxMSLU__wopen @@ -279,14 +287,31 @@ enum wxFileKind #define wxStat wxMSLU__wstat #endif #else // !wxUSE_UNICODE_MSLU - #define wxOpen _wopen - #define wxAccess _waccess - #define wxMkDir _wmkdir - #define wxRmDir _wrmdir - #ifdef wxHAS_HUGE_FILES - #define wxStat _wstati64 + #ifdef __BORLANDC__ + #if __BORLANDC__ >= 0x550 && __BORLANDC__ <= 0x551 + WXDLLIMPEXP_BASE int wxOpen(const wxChar *pathname, + int flags, mode_t mode); + #else + #define wxOpen _wopen + #endif + #define wxAccess _waccess + #define wxMkDir _wmkdir + #define wxRmDir _wrmdir + #ifdef wxHAS_HUGE_FILES + #define wxStat _wstati64 + #else + #define wxStat _wstat + #endif #else - #define wxStat _wstat + #define wxOpen _wopen + #define wxAccess _waccess + #define wxMkDir _wmkdir + #define wxRmDir _wrmdir + #ifdef wxHAS_HUGE_FILES + #define wxStat _wstati64 + #else + #define wxStat _wstat + #endif #endif #endif // wxUSE_UNICODE_MSLU/!wxUSE_UNICODE_MSLU #else // !wxUSE_UNICODE @@ -427,7 +452,7 @@ const int wxInvalidOffset = -1; WXDLLIMPEXP_BASE bool wxFileExists(const wxString& filename); // does the path exist? (may have or not '/' or '\\' at the end) -WXDLLIMPEXP_BASE bool wxDirExists(const wxChar *pszPathName); +WXDLLIMPEXP_BASE bool wxDirExists(const wxString& pathName); WXDLLIMPEXP_BASE bool wxIsAbsolutePath(const wxString& filename);