projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed refresh problem with holidays in wxCalendarCtrl
[wxWidgets.git]
/
src
/
common
/
file.cpp
diff --git
a/src/common/file.cpp
b/src/common/file.cpp
index 89d17ff691b73ca7ba76ae720da8237a520f449c..ef24f40f8396bea670b4ea771d4f92039ac8f07b 100644
(file)
--- a/
src/common/file.cpp
+++ b/
src/common/file.cpp
@@
-122,8
+122,9
@@
#define R_OK 4
#endif
#define R_OK 4
#endif
-// there is no distinction between text and binary files under Unix
-#ifdef __UNIX__
+// there is no distinction between text and binary files under Unix, so define
+// O_BINARY as 0 if the system headers don't do it already
+#if defined(__UNIX__) && !defined(O_BINARY)
#define O_BINARY (0)
#endif //__UNIX__
#define O_BINARY (0)
#endif //__UNIX__
@@
-219,10
+220,11
@@
bool wxFile::Create(const wxChar *szFileName, bool bOverwrite, int accessMode)
// 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
#ifdef __WXMAC__
// 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
#ifdef __WXMAC__
- int fd = open(wxUnix2MacFilename( szFileName ), O_CREAT | (bOverwrite ? O_TRUNC : O_EXCL), access);
+
int fd = open(wxUnix2MacFilename( szFileName ), O_CREAT | (bOverwrite ? O_TRUNC : O_EXCL), access);
#else
int fd = open(wxFNCONV(szFileName),
#else
int fd = open(wxFNCONV(szFileName),
- O_WRONLY | O_CREAT | (bOverwrite ? O_TRUNC : O_EXCL)
+ O_BINARY | O_WRONLY | O_CREAT |
+ (bOverwrite ? O_TRUNC : O_EXCL)
ACCESS(accessMode));
#endif
if ( fd == -1 ) {
ACCESS(accessMode));
#endif
if ( fd == -1 ) {
@@
-259,7
+261,7
@@
bool wxFile::Open(const wxChar *szFileName, OpenMode mode, int accessMode)
}
#ifdef __WXMAC__
}
#ifdef __WXMAC__
- int fd = open(wxUnix2MacFilename( szFileName ), flags, access);
+
int fd = open(wxUnix2MacFilename( szFileName ), flags, access);
#else
int fd = open(wxFNCONV(szFileName), flags ACCESS(accessMode));
#endif
#else
int fd = open(wxFNCONV(szFileName), flags ACCESS(accessMode));
#endif