octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MSVC patch: additional file information support + flexible sepchar d


From: John W. Eaton
Subject: Re: MSVC patch: additional file information support + flexible sepchar detection
Date: Wed, 13 Jun 2007 02:48:16 -0400

On  6-Jun-2007, Michael Goffioul wrote:

| On 6/6/07, John W. Eaton <address@hidden> wrote:
| > 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.
| 
| I don't think it's a problem. MSVC, MinGW and cygwin should support both
| type of slashes in pathnames.
| 
| > + #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?
| 
| This is related to code I tried, but removed (O_BINARY is not used in the
| file anyway). The reason was that O_BINARY seemed to be MSVC specific;
| defining it to 0 on other systems wouldn't affect anything. You can safely
| remove that part of the patch.

You mean all of this:

#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

#if defined (HAVE_UTIME_H)
#include <utime.h>
#elif defined (HAVE_SYS_UTIME_H)
#include <sys/utime.h>
#endif

#if ! defined (HAVE_CHMOD) && defined (HAVE__CHMOD)
#define chmod _chmod
#define HAVE_CHMOD 1
#endif

#if ! defined (HAVE_UTIME) \
        && (defined (HAVE__UTIME) || defined (HAVE__UTIME32))
#define utime _utime
#define utimbuf _utimbuf
#define HAVE_UTIME 1
#endif

#if ! defined (S_IFMT) && defined (_S_IFMT)
#define S_IFMT _S_IFMT
#endif

#if ! defined (O_RDONLY) && defined (_O_RDONLY)
#define O_RDONLY _O_RDONLY
#endif

#if ! defined (O_WRONLY) && defined (_O_WRONLY)
#define O_WRONLY _O_WRONLY
#endif

#if ! defined (O_CREAT) && defined (_O_CREAT)
#define O_CREAT _O_CREAT
#endif

#ifndef O_BINARY
#ifdef _O_BINARY
#define O_BINARY _O_BINARY
#else
#define O_BINARY 0
#endif
#endif

?  Now that I look at it, I don't see where any of this is needed in
liboctave/file-ops.cc.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]