X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1044b90c1b6dabee7327a9a2898725af9cc018b8..ea276239125ab295122820c6d6a03b729431f7e7:/include/wx/filefn.h diff --git a/include/wx/filefn.h b/include/wx/filefn.h index ba57e38001..269a645e82 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -15,6 +15,7 @@ #include "wx/list.h" #include "wx/arrstr.h" +#ifndef __WXPALMOS5__ #ifdef __WXWINCE__ #include "wx/msw/wince/time.h" #include "wx/msw/private.h" @@ -39,6 +40,7 @@ #include #endif #endif +#endif // !__WXPALMOS5__ #ifdef __OS2__ // need to check for __OS2__ first since currently both @@ -58,7 +60,7 @@ #endif #if defined(__WINDOWS__) && !defined(__WXMICROWIN__) -#if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ ) && !defined(__SALFORDC__) && !defined(__WXWINCE__) && !defined(__CYGWIN__) +#if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ ) && !defined(__WXWINCE__) && !defined(__CYGWIN__) #include #include #include @@ -83,14 +85,11 @@ #include #endif -#ifdef __SALFORDC__ - #include - #include -#endif - +#ifndef __WXPALMOS5__ #ifndef __WXWINCE__ #include // O_RDONLY &c #endif +#endif // !__WXPALMOS5__ // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -116,6 +115,8 @@ typedef long off_t; #elif defined(__MWERKS__) && !defined(__INTEL__) && !defined(__MACH__) typedef long off_t; +#elif defined(__WXPALMOS5__) + typedef long off_t; #endif enum wxSeekMode @@ -201,7 +202,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 @@ -236,9 +237,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) @@ -246,12 +254,15 @@ enum wxFileKind #endif // wxHAS_HUGE_FILES/!wxHAS_HUGE_FILES #ifndef __WATCOMC__ - #if !defined(__BORLANDC__) || (__BORLANDC__ > 0x540) - // NB: this one is not POSIX and always has the underscore - #define wxFsync _commit - - #define HAVE_FSYNC - #endif // BORLANDC + #if !defined(__BORLANDC__) || (__BORLANDC__ > 0x540) + // NB: this one is not POSIX and always has the underscore + #define wxFsync _commit + + // could be already defined by configure (Cygwin) + #ifndef HAVE_FSYNC + #define HAVE_FSYNC + #endif + #endif // BORLANDC #endif #define wxEof wxPOSIX_IDENT(eof) @@ -337,20 +348,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 @@ -381,6 +403,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 @@ -615,6 +674,9 @@ WXDLLIMPEXP_BASE bool wxIsExecutable(const wxString &path); // CYGWIN also uses UNIX settings #define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX #define wxPATH_SEP wxPATH_SEP_UNIX +#elif defined(__WXPALMOS__) + #define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX + #define wxPATH_SEP wxPATH_SEP_UNIX #elif defined(__MAC__) #define wxFILE_SEP_PATH wxFILE_SEP_PATH_MAC #define wxPATH_SEP wxPATH_SEP_MAC