diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-09-07 13:20:14 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-09-07 13:20:14 +0000 |
commit | e1c75e5922a4f031e9f8312d1f981f63bcbeb48d (patch) | |
tree | f7fba7bfecf6fb621a8c5f84c88296d411ffa928 /lib/common/FileStream.h | |
parent | f6e4a8c70c99f8af53125223cb5e2b447bf0fcd5 (diff) |
Fix test regression on Windows where a const char pointer was treated
as a file handle instead of as a string.
Diffstat (limited to 'lib/common/FileStream.h')
-rw-r--r-- | lib/common/FileStream.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/common/FileStream.h b/lib/common/FileStream.h index 5efb91ea..e3ab9f46 100644 --- a/lib/common/FileStream.h +++ b/lib/common/FileStream.h @@ -38,6 +38,18 @@ public: int flags = O_RDONLY, #endif int mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)); + + // Ensure that const char * name doesn't end up as a handle + // on Windows! + + FileStream(const char *pFilename, +#ifdef WIN32 + int flags = (O_RDONLY | O_BINARY), +#else + int flags = O_RDONLY, +#endif + int mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)); + FileStream(tOSFileHandle FileDescriptor); virtual ~FileStream(); @@ -56,6 +68,7 @@ private: tOSFileHandle mOSFileHandle; bool mIsEOF; FileStream(const FileStream &rToCopy) { /* do not call */ } + void AfterOpen(); // for debugging.. std::string mFileName; |