X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..1e287c5df77608397a6b29e185a0493a78799550:/include/wx/filefn.h diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 1c6246b13e..1699933e4f 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -172,7 +172,9 @@ enum wxFileKind defined(__BORLANDC__) \ ) + // temporary defines just used immediately below #undef wxHAS_HUGE_FILES + #undef wxHAS_HUGE_STDIO_FILES // detect compilers which have support for huge files #if defined(__VISUALC__) @@ -183,6 +185,17 @@ enum wxFileKind #define wxHAS_HUGE_FILES 1 #endif + // detect compilers which have support for huge stdio files + #if wxCHECK_VISUALC_VERSION(8) + #define wxHAS_HUGE_STDIO_FILES + #define wxFseek _fseeki64 + #define wxFtell _ftelli64 + #elif wxCHECK_MINGW32_VERSION(3, 5) // mingw-runtime version (not gcc) + #define wxHAS_HUGE_STDIO_FILES + #define wxFseek fseeko64 + #define wxFtell ftello64 + #endif + // other Windows compilers (DMC, Watcom, Metrowerks and Borland) don't have // huge file support (or at least not all functions needed for it by wx) // currently @@ -344,7 +357,7 @@ enum wxFileKind // finally the default char-type versions #if wxUSE_UNICODE - #if wxUSE_UNICODE_MSLU + #if wxUSE_UNICODE_MSLU || defined(__WX_STRICT_ANSI_GCC__) // implement the missing file functions in Win9x ourselves WXDLLIMPEXP_BASE int wxMSLU__wopen(const wxChar *name, int flags, int mode); @@ -397,16 +410,19 @@ enum wxFileKind #endif // wxHAS_UNDERSCORES_IN_POSIX_IDENTS #ifdef wxHAS_HUGE_FILES - // wxFile is present and supports large files. Currently wxFFile - // doesn't have large file support with any Windows compiler (even - // Win64 ones). + // wxFile is present and supports large files. #if wxUSE_FILE #define wxHAS_LARGE_FILES #endif + // wxFFile is present and supports large files + #if wxUSE_FFILE && defined wxHAS_HUGE_STDIO_FILES + #define wxHAS_LARGE_FFILES + #endif #endif - // it's a private define, undefine it so that nobody gets tempted to use it + // private defines, undefine so that nobody gets tempted to use #undef wxHAS_HUGE_FILES + #undef wxHAS_HUGE_STDIO_FILES #elif defined (__WXPALMOS__) typedef off_t wxFileOffset; #ifdef _LARGE_FILES @@ -458,6 +474,10 @@ enum wxFileKind #if wxUSE_FFILE && (SIZEOF_LONG == 8 || defined HAVE_FSEEKO) #define wxHAS_LARGE_FFILES #endif + #ifdef HAVE_FSEEKO + #define wxFseek fseeko + #define wxFtell ftello + #endif #else #define wxFileOffsetFmtSpec wxT("") #endif @@ -491,6 +511,15 @@ enum wxFileKind #define wxCRT_Lstat wxCRT_Stat #endif +// define wxFseek/wxFtell to large file versions if available (done above) or +// to fseek/ftell if not, to save ifdefs in using code +#ifndef wxFseek + #define wxFseek fseek +#endif +#ifndef wxFtell + #define wxFtell ftell +#endif + inline int wxAccess(const wxString& path, mode_t mode) { return wxCRT_Access(path.fn_str(), mode); } inline int wxOpen(const wxString& path, int flags, mode_t mode)