+// Wrappers around Win32 api functions like CreateFile, ReadFile and such
+// Implemented in filefnwce.cpp
+#if defined( __WXWINCE__)
+ typedef __int64 wxFileOffset;
+ #define wxFileOffsetFmtSpec wxT("I64")
+ WXDLLIMPEXP_BASE int wxCRT_Open(const wxChar *filename, int oflag, int WXUNUSED(pmode));
+ WXDLLIMPEXP_BASE int wxCRT_Access(const wxChar *name, int WXUNUSED(how));
+ WXDLLIMPEXP_BASE int wxClose(int fd);
+ WXDLLIMPEXP_BASE int wxFsync(int WXUNUSED(fd));
+ WXDLLIMPEXP_BASE int wxRead(int fd, void *buf, unsigned int count);
+ WXDLLIMPEXP_BASE int wxWrite(int fd, const void *buf, unsigned int count);
+ WXDLLIMPEXP_BASE int wxEof(int fd);
+ WXDLLIMPEXP_BASE wxFileOffset wxSeek(int fd, wxFileOffset offset, int origin);
+ #define wxLSeek wxSeek
+ WXDLLIMPEXP_BASE wxFileOffset wxTell(int fd);
+
+ // always Unicode under WinCE
+ #define wxCRT_MkDir _wmkdir
+ #define wxCRT_RmDir _wrmdir
+ #define wxCRT_Stat _wstat
+ #define wxStructStat struct _stat
+#elif (defined(__WXMSW__) || defined(__OS2__)) && !defined(__WXPALMOS__) && \
+ ( \
+ defined(__VISUALC__) || \
+ defined(__MINGW64__) || \
+ (defined(__MINGW32__) && !defined(__WINE__) && \
+ wxCHECK_W32API_VERSION(0, 5)) || \
+ defined(__MWERKS__) || \
+ defined(__DMC__) || \
+ defined(__WATCOMC__) || \
+ 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__)
+ #define wxHAS_HUGE_FILES 1
+ #elif defined(__MINGW32__) || defined(__MINGW64__)
+ #define wxHAS_HUGE_FILES 1
+ #elif defined(_LARGE_FILES)
+ #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
+
+ // types
+
+ #ifdef wxHAS_HUGE_FILES
+ typedef wxLongLong_t wxFileOffset;
+ #define wxFileOffsetFmtSpec wxLongLongFmtSpec
+ #else
+ typedef off_t wxFileOffset;
+ #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
+
+ // 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 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 wxHAS_HUGE_FILES
+ #define wxStructStat struct stati64
+ #else
+ #if wxUSE_UNICODE
+ #define wxStructStat struct _stat
+ #else
+ #define wxStructStat struct stat
+ #endif
+ #endif
+ #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
+ #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4)
+ #define wxStructStat struct _wstat
+ #else
+ #define wxStructStat struct _stat
+ #endif
+ #endif
+ #endif // __BORLANDC__/!__BORLANDC__
+
+