// Implemented in filefnwce.cpp
#if defined( __WXWINCE__)
typedef __int64 wxFileOffset;
+ typedef unsigned __int64 wxFileSize_t;
#define wxFileOffsetFmtSpec _("I64")
int wxOpen(const wxChar *filename, int oflag, int WXUNUSED(pmode));
int wxAccess(const wxChar *name, int WXUNUSED(how));
// detect compilers which have support for huge files (currently only
// Digital Mars doesn't)
+ #ifndef __PALMOS__
#include "wx/msw/private.h"
+ #endif
#undef wxHAS_HUGE_FILES
#if defined(__MINGW32__)
#if wxHAS_HUGE_FILES
typedef wxLongLong_t wxFileOffset;
+ typedef unsigned wxLongLong_t wxFileSize_t;
#define wxFileOffsetFmtSpec wxLongLongFmtSpec
#else
typedef off_t wxFileOffset;
- #define wxFileOffsetFmtSpec _("")
+ typedef unsigned long wxFileSize_t;
#endif
#define wxClose _close
_write(fd, (const char *)buf, nCount)
#endif
#else
- #if defined(__DMC__) || defined(__WATCOMC__)
+ #if defined(__WATCOMC__)
+ inline wxFileSize_t wxRead( int handle, void *buffer, wxFileSize_t len )
+ { return ::read( handle, buffer, (unsigned int)len ); }
+ inline wxFileSize_t wxWrite( int handle, const void *buffer, wxFileSize_t len )
+ { return ::write( handle, buffer, (unsigned int)len ); }
+ #elif defined(__DMC__)
#define wxRead ::read
#define wxWrite ::write
#else
#endif
// constants (unless already defined by the user code)
- #if !defined(O_RDONLY) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
- #define O_RDONLY _O_RDONLY
- #define O_WRONLY _O_WRONLY
- #define O_RDWR _O_RDWR
- #define O_EXCL _O_EXCL
- #define O_CREAT _O_CREAT
- #define O_BINARY _O_BINARY
- #endif
+ #if !defined(__BORLANDC__) && !defined(__WATCOMC__) && !defined(__PALMOS__)
+ #ifndef O_RDONLY
+ #define O_RDONLY _O_RDONLY
+ #define O_WRONLY _O_WRONLY
+ #define O_RDWR _O_RDWR
+ #define O_EXCL _O_EXCL
+ #define O_CREAT _O_CREAT
+ #define O_BINARY _O_BINARY
+ #endif
- #if !defined(__BORLANDC__) && !defined(__WATCOMC__)
- #define S_IFMT _S_IFMT
- #define S_IFDIR _S_IFDIR
- #define S_IFREG _S_IFREG
- #endif // O_RDONLY
+ #ifndef S_IFMT
+ #define S_IFMT _S_IFMT
+ #define S_IFDIR _S_IFDIR
+ #define S_IFREG _S_IFREG
+ #endif
+ #endif
// It's a private define, undefine it so nobody gets tempted to use it
#undef wxHAS_HUGE_FILES
typedef off_t wxFileOffset;
#ifdef _LARGE_FILES
#define wxFileOffsetFmtSpec wxLongLongFmtSpec
+ wxCOMPILE_TIME_ASSERT( sizeof(off_t) == sizeof(wxLongLong_t),
+ BadFileSizeType );
+ typedef unsigned wxLongLong_t wxFileSize_t;
#else
#define wxFileOffsetFmtSpec _T("")
+ typedef unsigned long wxFileSize_t;
#endif
// functions
#define wxClose close
// VisualAge C++ V4.0 cannot have any external linkage const decs
// in headers included by more than one primary source
//
-extern const wxFileOffset wxInvalidOffset;
+extern const wxFileSize_t wxInvalidOffset;
#else
-const wxFileOffset wxInvalidOffset = (wxFileOffset)-1;
+const wxFileSize_t wxInvalidOffset = (wxFileSize_t)-1;
#endif
// ----------------------------------------------------------------------------