[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MSVC patch: additional file information support + flexible sepchar detec
From: |
John W. Eaton |
Subject: |
MSVC patch: additional file information support + flexible sepchar detection |
Date: |
Wed, 6 Jun 2007 01:37:26 -0400 |
On 5-Jun-2007, Michael Goffioul wrote:
I applied the patch with minor changes and I have some questions.
| *************** std::string file_ops::dir_sep_str ("/");
| *** 64,75 ****
| #endif
|
| #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \
| ! && defined (OCTAVE_HAVE_POSIX_FILESYSTEM))
| std::string file_ops::dir_sep_chars ("/\\");
| #else
| std::string file_ops::dir_sep_chars (file_ops::dir_sep_str);
| #endif
|
| // We provide a replacement for mkdir().
|
| int
| --- 78,119 ----
| #endif
|
| #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \
| ! && (defined (OCTAVE_HAVE_POSIX_FILESYSTEM) || defined (_MSC_VER)))
| std::string file_ops::dir_sep_chars ("/\\");
| #else
| std::string file_ops::dir_sep_chars (file_ops::dir_sep_str);
| #endif
I'd rather avoid checking _MSC_VER here (or anywhere, really). Would
there be any harm in doing this
#if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM)
std::string file_ops::dir_sep_chars ("/\\");
#else
std::string file_ops::dir_sep_chars (file_ops::dir_sep_str);
#endif
instead? I made this change when I checked it in.
+ #if ! defined (O_RDONLY) && defined (_O_RDONLY)
+ #define O_RDONLY _O_RDONLY
+ #define O_WRONLY _O_WRONLY
+ #define O_CREAT _O_CREAT
+ #endif
+
+ #ifndef O_BINARY
+ #ifdef _O_BINARY
+ #define O_BINARY _O_BINARY
+ #else
+ #define O_BINARY 0
+ #endif
+ #endif
Why is O_BINARY different here?
Thanks,
jwe