X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b96afaa92d2f4c2965e7086c5d9a9a0efc0fb94..75b6c4ce9236da28f349c3393b8436903d92815f:/include/wx/filefn.h diff --git a/include/wx/filefn.h b/include/wx/filefn.h index a44970676f..4f9435e6dd 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -163,6 +163,7 @@ enum wxFileKind #elif (defined(__WXMSW__) || defined(__OS2__)) && !defined(__WXPALMOS__) && \ ( \ defined(__VISUALC__) || \ + defined(__MINGW64__) || \ (defined(__MINGW32__) && !defined(__WINE__) && \ wxCHECK_W32API_VERSION(0, 5)) || \ defined(__MWERKS__) || \ @@ -176,7 +177,7 @@ enum wxFileKind // detect compilers which have support for huge files #if defined(__VISUALC__) #define wxHAS_HUGE_FILES 1 - #elif defined(__MINGW32__) + #elif defined(__MINGW32__) || defined(__MINGW64__) #define wxHAS_HUGE_FILES 1 #elif defined(_LARGE_FILES) #define wxHAS_HUGE_FILES 1 @@ -202,7 +203,7 @@ enum wxFileKind // to avoid using them as they're not present in earlier versions and // always using the native functions spelling is easier than testing for // the versions - #if defined(__BORLANDC__) || defined(__DMC__) || defined(__WATCOMC__) + #if defined(__BORLANDC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__MINGW64__) #define wxPOSIX_IDENT(func) ::func #else // by default assume MSVC-compatible names #define wxPOSIX_IDENT(func) _ ## func @@ -237,9 +238,16 @@ enum wxFileKind #endif #ifdef wxHAS_HUGE_FILES - #define wxSeek wxPOSIX_IDENT(lseeki64) - #define wxLseek wxPOSIX_IDENT(lseeki64) - #define wxTell wxPOSIX_IDENT(telli64) + #ifndef __MINGW64__ + #define wxSeek wxPOSIX_IDENT(lseeki64) + #define wxLseek wxPOSIX_IDENT(lseeki64) + #define wxTell wxPOSIX_IDENT(telli64) + #else + // unfortunately, mingw-W64 is somewhat inconsistent... + #define wxSeek _lseeki64 + #define wxLseek _lseeki64 + #define wxTell _telli64 + #endif #else // !wxHAS_HUGE_FILES #define wxSeek wxPOSIX_IDENT(lseek) #define wxLseek wxPOSIX_IDENT(lseek) @@ -341,20 +349,31 @@ enum wxFileKind // Types: Notice that Watcom is the only compiler to have a wide char // version of struct stat as well as a wide char stat function variant. - // This was droped since OW 1.4 "for consistency across platforms". - #ifdef wxHAS_HUGE_FILES - #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4) - #define wxStructStat struct _wstati64 + // This was dropped since OW 1.4 "for consistency across platforms". + // + // Borland is also special in that it uses _stat with Unicode functions + // (for MSVC compatibility?) but stat with ANSI ones + #ifdef __BORLANDC__ + #if wxUSE_UNICODE + #define wxStructStat struct _stat #else - #define wxStructStat struct _stati64 + #define wxStructStat struct stat #endif - #else - #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4) - #define wxStructStat struct _wstat + #else // !__BORLANDC__ + #ifdef wxHAS_HUGE_FILES + #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4) + #define wxStructStat struct _wstati64 + #else + #define wxStructStat struct _stati64 + #endif #else - #define wxStructStat struct _stat + #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4) + #define wxStructStat struct _wstat + #else + #define wxStructStat struct _stat + #endif #endif - #endif + #endif // __BORLANDC__/!__BORLANDC__ // constants (unless already defined by the user code) #ifdef wxHAS_UNDERSCORES_IN_POSIX_IDENTS @@ -385,6 +404,43 @@ enum wxFileKind // it's a private define, undefine it so that nobody gets tempted to use it #undef wxHAS_HUGE_FILES +#elif defined (__WXPALMOS__) + typedef off_t wxFileOffset; +#ifdef _LARGE_FILES + #define wxFileOffsetFmtSpec wxLongLongFmtSpec + wxCOMPILE_TIME_ASSERT( sizeof(off_t) == sizeof(wxLongLong_t), BadFileSizeType ); + // wxFile is present and supports large files + #ifdef wxUSE_FILE + #define wxHAS_LARGE_FILES + #endif + // wxFFile is present and supports large files + #if SIZEOF_LONG == 8 || defined HAVE_FSEEKO + #define wxHAS_LARGE_FFILES + #endif +#else + #define wxFileOffsetFmtSpec _T("") +#endif + #define wxClose close + #define wxRead ::read + #define wxWrite ::write + #define wxLseek lseek + #define wxSeek lseek + #define wxFsync fsync + #define wxEof eof + + #define wxCRT_MkDir mkdir + #define wxCRT_RmDir rmdir + + #define wxTell(fd) lseek(fd, 0, SEEK_CUR) + + #define wxStructStat struct stat + + #define wxCRT_Open open + #define wxCRT_Stat svfs_stat + #define wxCRT_Lstat lstat + #define wxCRT_Access access + + #define wxHAS_NATIVE_LSTAT #else // Unix or Windows using unknown compiler, assume POSIX supported typedef off_t wxFileOffset; #ifdef _LARGE_FILES