#endif
#endif
-#if defined(__VISUALC__) || ( defined(__MWERKS__) && defined( __INTEL__) )
+#if (defined(__VISUALC__) && !defined(__WXWINCE__)) || ( defined(__MWERKS__) && defined( __INTEL__) )
typedef _off_t off_t;
#elif defined(__SYMANTEC__)
typedef long off_t;
typedef long off_t;
#endif
-#if defined(__VISAGECPP__) && __IBMCPP__ >= 400
-//
-// VisualAge C++ V4.0 cannot have any external linkage const decs
-// in headers included by more than one primary source
-//
-extern const off_t wxInvalidOffset;
-#else
-const off_t wxInvalidOffset = (off_t)-1;
-#endif
-
enum wxSeekMode
{
wxFromStart,
// Wrappers around Win32 api functions like CreateFile, ReadFile and such
// Implemented in filefnwce.cpp
-#if defined( __WINCE__)
+#if defined( __WXWINCE__)
typedef __int64 wxFileOffset;
#define wxFileOffsetFmtSpec _("I64")
int wxOpen(const wxChar *filename, int oflag, int WXUNUSED(pmode));
|| ( defined(__DMC__) && defined(__WXMSW__) ) \
|| ( defined(__WATCOMC__) && defined(__WXMSW__) )
- // Not all of the Win32 compilers do have huge file support, for example
- // the Digitalmars compiler does not have huge file size support
+ // detect compilers which have support for huge files (currently only
+ // Digital Mars doesn't)
+ #include "wx/msw/private.h"
+
#undef __HUGEFILES_SUPPORTED
- #if _INTEGRAL_MAX_BITS >= 64 && !defined(__DMC__)
+ #if defined(__MINGW32__)
+ #define __HUGEFILES_SUPPORTED 1
+ #elif defined(__DMC__)
+ #define __HUGEFILES_SUPPORTED 0
+ #elif ((_INTEGRAL_MAX_BITS >= 64) || defined(_LARGE_FILES))
#define __HUGEFILES_SUPPORTED 1
#else
#define __HUGEFILES_SUPPORTED 0
typedef wxLongLong_t wxFileOffset;
#define wxFileOffsetFmtSpec wxLongLongFmtSpec
#else
- typedef int wxFileOffset;
+ typedef off_t wxFileOffset;
#define wxFileOffsetFmtSpec _("")
#endif
#define wxWrite _write(fd, (const char *)buf, nCount)
#endif
#else
- #ifdef __DMC__
+ #if defined(__DMC__) || defined(__WATCOMC__)
#define wxRead ::read
#define wxWrite ::write
#else
#define wxTell _tell
#endif
#define wxFsync _commit
- #define wxEof _eof
+ #if defined(__WATCOMC__)
+ #define wxEof ::eof
+ #else
+ #define wxEof _eof
+ #endif
#if wxUSE_UNICODE
#if wxUSE_UNICODE_MSLU
#endif
#endif
- // types
+ // 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
#if __HUGEFILES_SUPPORTED
- #if wxUSE_UNICODE
+ #if wxUSE_UNICODE && defined(__WATCOMC__)
#define wxStructStat struct _wstati64
#else
#define wxStructStat struct _stati64
#endif
#else
- #if wxUSE_UNICODE
+ #if wxUSE_UNICODE && defined(__WATCOMC__)
#define wxStructStat struct _wstat
#else
#define wxStructStat struct _stat
// It's a private define, undefine it so nobody gets tempted to use it
#undef __HUGEFILES_SUPPORTED
-#else
+#else // Unix platforms using configure
typedef off_t wxFileOffset;
#ifdef _LARGE_FILES
#define wxFileOffsetFmtSpec wxLongLongFmtSpec
#define wxStat stat
#define wxAccess access
#endif
+#endif // platforms
-#endif // VC++
+#if defined(__VISAGECPP__) && __IBMCPP__ >= 400
+//
+// VisualAge C++ V4.0 cannot have any external linkage const decs
+// in headers included by more than one primary source
+//
+extern const wxFileOffset wxInvalidOffset;
+#else
+const wxFileOffset wxInvalidOffset = (wxFileOffset)-1;
+#endif
// ----------------------------------------------------------------------------
// functions