// 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));
#undef __HUGEFILES_SUPPORTED
#if defined(__MINGW32__)
#define __HUGEFILES_SUPPORTED 1
+ #elif defined(__MWERKS__)
+ #define __HUGEFILES_SUPPORTED 0
#elif defined(__DMC__)
#define __HUGEFILES_SUPPORTED 0
#elif ((_INTEGRAL_MAX_BITS >= 64) || defined(_LARGE_FILES))
#if defined(__MWERKS__)
#if __MSL__ >= 0x6000
- #define wxRead _read(fd, (void *)buf, nCount)
- #define wxWrite _write(fd, (void *)buf, nCount)
+ #define wxRead(fd, buf, nCount) _read(fd, (void *)buf, nCount)
+ #define wxWrite(fd, buf, nCount) _write(fd, (void *)buf, nCount)
#else
- #define wxRead _read(fd, (const char *)buf, nCount)
- #define wxWrite _write(fd, (const char *)buf, nCount)
+ #define wxRead(fd, buf, nCount)\
+ _read(fd, (const char *)buf, nCount)
+ #define wxWrite(fd, buf, nCount)\
+ _write(fd, (const char *)buf, nCount)
#endif
#else
#if defined(__DMC__) || defined(__WATCOMC__)
// classes
// ----------------------------------------------------------------------------
+#ifdef __UNIX__
+
+// set umask to the given value in ctor and reset it to the old one in dtor
+class WXDLLIMPEXP_BASE wxUmaskChanger
+{
+public:
+ // change the umask to the given one if it is not -1: this allows to write
+ // the same code whether you really want to change umask or not, as is in
+ // wxFileConfig::Flush() for example
+ wxUmaskChanger(int umaskNew)
+ {
+ m_umaskOld = umaskNew == -1 ? -1 : (int)umask((mode_t)umaskNew);
+ }
+
+ ~wxUmaskChanger()
+ {
+ if ( m_umaskOld != -1 )
+ umask((mode_t)m_umaskOld);
+ }
+
+private:
+ int m_umaskOld;
+};
+
+// this macro expands to an "anonymous" wxUmaskChanger object under Unix and
+// nothing elsewhere
+#define wxCHANGE_UMASK(m) wxUmaskChanger wxMAKE_UNIQUE_NAME(umaskChanger_)(m)
+
+#else // !__UNIX__
+
+#define wxCHANGE_UMASK(m)
+
+#endif // __UNIX__/!__UNIX__
+
+
// Path searching
class WXDLLIMPEXP_BASE wxPathList : public wxStringList
{