Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63434 - in trunk/libs/iostreams: src test test/detail
From: daniel_james_at_[hidden]
Date: 2010-06-29 11:03:37


Author: danieljames
Date: 2010-06-29 11:03:37 EDT (Tue, 29 Jun 2010)
New Revision: 63434
URL: http://svn.boost.org/trac/boost/changeset/63434

Log:
Some more windows fixes for my recent iostreams changes.
Text files modified:
   trunk/libs/iostreams/src/file_descriptor.cpp | 18 ++++++------------
   trunk/libs/iostreams/test/detail/file_handle.hpp | 8 +++++++-
   trunk/libs/iostreams/test/file_descriptor_test.cpp | 4 ++--
   3 files changed, 15 insertions(+), 15 deletions(-)

Modified: trunk/libs/iostreams/src/file_descriptor.cpp
==============================================================================
--- trunk/libs/iostreams/src/file_descriptor.cpp (original)
+++ trunk/libs/iostreams/src/file_descriptor.cpp 2010-06-29 11:03:37 EDT (Tue, 29 Jun 2010)
@@ -493,13 +493,11 @@
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
 void file_descriptor_source::open(int fd, file_descriptor_flags f)
-{ file_descriptor::open(fd, static_cast<detail::file_descriptor_impl::flags>(f)); }
+{ file_descriptor::open(fd, f); }
 
 #if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 void file_descriptor_source::open(int fd, bool close_on_exit)
-{ file_descriptor::open(fd, close_on_exit ?
- detail::file_descriptor_impl::close_always :
- detail::file_descriptor_impl::close_on_close); }
+{ file_descriptor::open(fd, close_on_exit); }
 #endif
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//
@@ -535,13 +533,11 @@
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
 file_descriptor_sink::file_descriptor_sink(int fd, file_descriptor_flags f)
-{ open(fd, static_cast<detail::file_descriptor_impl::flags>(f)); }
+{ open(fd, f); }
 
 #if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 file_descriptor_sink::file_descriptor_sink(int fd, bool close_on_exit)
-{ open(fd, close_on_exit ?
- detail::file_descriptor_impl::close_always :
- detail::file_descriptor_impl::close_on_close); }
+{ open(fd, close_on_exit); }
 #endif
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//
@@ -569,13 +565,11 @@
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
 void file_descriptor_sink::open(int fd, file_descriptor_flags f)
-{ file_descriptor::open(fd, static_cast<detail::file_descriptor_impl::flags>(f)); }
+{ file_descriptor::open(fd, f); }
 
 #if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 void file_descriptor_sink::open(int fd, bool close_on_exit)
-{ file_descriptor::open(fd, close_on_exit ?
- detail::file_descriptor_impl::close_always :
- detail::file_descriptor_impl::close_on_close); }
+{ file_descriptor::open(fd, close_on_exit); }
 #endif
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//

Modified: trunk/libs/iostreams/test/detail/file_handle.hpp
==============================================================================
--- trunk/libs/iostreams/test/detail/file_handle.hpp (original)
+++ trunk/libs/iostreams/test/detail/file_handle.hpp 2010-06-29 11:03:37 EDT (Tue, 29 Jun 2010)
@@ -15,6 +15,12 @@
 #include <fcntl.h>
 #include <string>
 
+#ifdef BOOST_IOSTREAMS_WINDOWS
+# include <io.h> // low-level file i/o.
+# define WINDOWS_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
 namespace boost { namespace iostreams { namespace test {
 
 #ifdef BOOST_IOSTREAMS_WINDOWS
@@ -33,7 +39,7 @@
                        NULL ); // hTemplateFile
 
     BOOST_REQUIRE (handle != INVALID_HANDLE_VALUE);
- return HANDLE;
+ return handle;
 }
 
 void close_file_handle(boost::iostreams::detail::file_handle handle)

Modified: trunk/libs/iostreams/test/file_descriptor_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/file_descriptor_test.cpp (original)
+++ trunk/libs/iostreams/test/file_descriptor_test.cpp 2010-06-29 11:03:37 EDT (Tue, 29 Jun 2010)
@@ -600,7 +600,7 @@
     }
 
     {
- boost_ios::detail::file_handle handle = open_handle(test1.name());
+ boost_ios::detail::file_handle handle = open_file_handle(test1.name());
         {
             boost_ios::file_descriptor_source source1;
             BOOST_CHECK(!source1.is_open());
@@ -613,7 +613,7 @@
     }
 
     {
- boost_ios::detail::file_handle handle = open_handle(test1.name());
+ boost_ios::detail::file_handle handle = open_file_handle(test1.name());
         {
             boost_ios::file_descriptor_source source1;
             BOOST_CHECK(!source1.is_open());


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