Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63452 - in trunk: boost/filesystem/v3 libs/filesystem/v3/test
From: bdawes_at_[hidden]
Date: 2010-06-30 11:20:24


Author: bemandawes
Date: 2010-06-30 11:20:21 EDT (Wed, 30 Jun 2010)
New Revision: 63452
URL: http://svn.boost.org/trac/boost/changeset/63452

Log:
Reverse logic so that standard library file I/O is assumed *not* to have wide character path extension, thus defaulting to the safer choice.
Text files modified:
   trunk/boost/filesystem/v3/fstream.hpp | 10 +++++-----
   trunk/libs/filesystem/v3/test/operations_test.cpp | 10 +++++-----
   2 files changed, 10 insertions(+), 10 deletions(-)

Modified: trunk/boost/filesystem/v3/fstream.hpp
==============================================================================
--- trunk/boost/filesystem/v3/fstream.hpp (original)
+++ trunk/boost/filesystem/v3/fstream.hpp 2010-06-30 11:20:21 EDT (Wed, 30 Jun 2010)
@@ -20,12 +20,12 @@
 
 #include <boost/config/abi_prefix.hpp> // must be the last #include
 
-// glibc++ and older Dinkumware don't have wchar_t overloads for file stream paths,
-// so on Windows use path::string() to get a narrow character c_str()
+// on Windows, except for standard libaries known to have wchar_t overloads for
+// file stream I/O, use path::string() to get a narrow character c_str()
 #if defined(BOOST_WINDOWS_API) \
- && (defined(__GLIBCXX__) || (defined(_CPPLIB_VER) && _CPPLIB_VER < 405))
-# define BOOST_FILESYSTEM_C_STR string().c_str()
-#else
+ && !(defined(_CPPLIB_VER) && _CPPLIB_VER >= 405) // not (Dinkumware with overloads)
+# define BOOST_FILESYSTEM_C_STR string().c_str() // use narrow, since wide not available
+#else // use the native c_str, which will be narrow on POSIX, wide on Windows
 # define BOOST_FILESYSTEM_C_STR c_str()
 #endif
 

Modified: trunk/libs/filesystem/v3/test/operations_test.cpp
==============================================================================
--- trunk/libs/filesystem/v3/test/operations_test.cpp (original)
+++ trunk/libs/filesystem/v3/test/operations_test.cpp 2010-06-30 11:20:21 EDT (Wed, 30 Jun 2010)
@@ -41,12 +41,12 @@
 # include <windows.h>
 #endif
 
-// glibc++ and older Dinkumware don't have wchar_t overloads for file stream paths,
-// so on Windows use path::string() to get a narrow character c_str()
+// on Windows, except for standard libaries known to have wchar_t overloads for
+// file stream I/O, use path::string() to get a narrow character c_str()
 #if defined(BOOST_WINDOWS_API) \
- && (defined(__GLIBCXX__) || (defined(_CPPLIB_VER) && _CPPLIB_VER < 405))
-# define BOOST_FILESYSTEM_C_STR string().c_str()
-#else
+ && !(defined(_CPPLIB_VER) && _CPPLIB_VER >= 405) // not (Dinkumware with overloads)
+# define BOOST_FILESYSTEM_C_STR string().c_str() // use narrow, since wide not available
+#else // use the native c_str, which will be narrow on POSIX, wide on Windows
 # define BOOST_FILESYSTEM_C_STR c_str()
 #endif
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk