#include <stdio.h> // SEEK_xxx constants
#include <fcntl.h> // O_RDONLY &c
-#if !defined(__MWERKS__) || defined(__WXMSW__)
+#ifndef __MWERKS__
+ #include <sys/types.h> // needed for stat
+ #include <sys/stat.h> // stat
+#elif defined(__MWERKS__) && ( defined(__WXMSW__) || defined(__MACH__) )
#include <sys/types.h> // needed for stat
#include <sys/stat.h> // stat
#endif
{
// if bOverwrite we create a new file or truncate the existing one,
// otherwise we only create the new file and fail if it already exists
-#if defined(__WXMAC__) && !defined(__UNIX__)
+#if defined(__WXMAC__) && !defined(__UNIX__) && !wxUSE_UNICODE
// Dominic Mazzoni [dmazzoni+@cs.cmu.edu] reports that open is still broken on the mac, so we replace
// int fd = open(wxUnix2MacFilename( szFileName ), O_CREAT | (bOverwrite ? O_TRUNC : O_EXCL), access);
int fd = creat( szFileName , accessMode);