octave-maintainers
[Top][All Lists]
Advanced

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

MSVC compiler support [patch 29]: Backslash in path


From: John W. Eaton
Subject: MSVC compiler support [patch 29]: Backslash in path
Date: Fri, 27 Oct 2006 09:57:52 -0400

On 17-Oct-2006, Michael Goffioul wrote:

| Converts forward slashes into backward slashes for default paths; this 
| allows
| to use the configure script in the MinGW-way 
| (--prefix=/usr/local/octave), and
| to produce code that works in the Win32-way, with backslashes.
| Index: src/defaults.cc
| ===================================================================
| RCS file: /cvs/octave/src/defaults.cc,v
| retrieving revision 1.61
| diff -p -c -r1.61 defaults.cc
| *** src/defaults.cc   27 Jul 2006 19:35:22 -0000      1.61
| --- src/defaults.cc   17 Oct 2006 11:07:42 -0000
| *************** Software Foundation, Inc., 51 Franklin S
| *** 29,34 ****
| --- 29,37 ----
|   
|   #include <iostream>
|   #include <string>
| + #ifdef _MSC_VER
| + #include <algorithm>
| + #endif
|   
|   #ifdef HAVE_UNISTD_H
|   #ifdef HAVE_SYS_TYPES_H
| *************** subst_octave_home (const std::string& s)
| *** 118,123 ****
| --- 121,130 ----
|       }
|       }
|   
| + #ifdef _MSC_VER
| +   std::replace(retval.begin(), retval.end(), '/', '\\');
| + #endif
| + 
|     return retval;
|   }
|   

OK, but instead of making this specific to _MSC_VER, I did it this
way:

  if (file_ops::dir_sep_char != '/')
    std::replace (retval.begin (), retval.end (), '/', file_ops::dir_sep_char);

Thanks,

jwe


reply via email to

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