Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58803 - in branches/release: boost/iostreams boost/iostreams/detail boost/iostreams/detail/adapter boost/iostreams/filter libs/iostreams libs/iostreams/src
From: daniel_james_at_[hidden]
Date: 2010-01-08 00:41:01


Author: danieljames
Date: 2010-01-08 00:40:59 EST (Fri, 08 Jan 2010)
New Revision: 58803
URL: http://svn.boost.org/trac/boost/changeset/58803

Log:
Merge iostreams changes.
Removed:
   branches/release/libs/iostreams/src/file_times.cpp
Properties modified:
   branches/release/boost/iostreams/ (props changed)
   branches/release/libs/iostreams/ (props changed)
Text files modified:
   branches/release/boost/iostreams/detail/adapter/concept_adapter.hpp | 25 ++++++++++++++++++++-----
   branches/release/boost/iostreams/detail/is_dereferenceable.hpp | 6 +++---
   branches/release/boost/iostreams/filter/bzip2.hpp | 6 +++---
   branches/release/boost/iostreams/filter/zlib.hpp | 6 +++---
   branches/release/libs/iostreams/src/bzip2.cpp | 6 +++---
   branches/release/libs/iostreams/src/zlib.cpp | 6 +++---
   6 files changed, 35 insertions(+), 20 deletions(-)

Modified: branches/release/boost/iostreams/detail/adapter/concept_adapter.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/adapter/concept_adapter.hpp (original)
+++ branches/release/boost/iostreams/detail/adapter/concept_adapter.hpp 2010-01-08 00:40:59 EST (Fri, 08 Jan 2010)
@@ -27,6 +27,15 @@
 // Must come last.
 #include <boost/iostreams/detail/config/disable_warnings.hpp> // MSVC.
 
+// If Boost.Exception has BOOST_ATTRIBUTE_NORETURN
+#if defined(_MSC_VER) || defined(__GNUC__)
+#define BOOST_IOSTREAMS_UNREACHABLE_RETURN(x) \
+ BOOST_UNREACHABLE_RETURN(x)
+#else
+#define BOOST_IOSTREAMS_UNREACHABLE_RETURN(x) \
+ return x;
+#endif
+
 namespace boost { namespace iostreams { namespace detail {
 
 template<typename Category> struct device_wrapper_impl;
@@ -139,6 +148,7 @@
           BOOST_IOS::openmode, any_tag )
     {
         boost::throw_exception(cant_seek());
+ BOOST_IOSTREAMS_UNREACHABLE_RETURN(0)
     }
 
     template<typename Device>
@@ -172,7 +182,8 @@
     static std::streamsize
     write( Device&, Dummy*, const typename char_type_of<Device>::type*,
            std::streamsize )
- { boost::throw_exception(cant_write()); }
+ { boost::throw_exception(cant_write());
+ BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
 };
 
 template<>
@@ -180,7 +191,8 @@
     template<typename Device, typename Dummy>
     static std::streamsize
     read(Device&, Dummy*, typename char_type_of<Device>::type*, std::streamsize)
- { boost::throw_exception(cant_read()); }
+ { boost::throw_exception(cant_read());
+ BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
 
     template<typename Device, typename Dummy>
     static std::streamsize
@@ -206,7 +218,8 @@
     static std::streampos
     seek( Filter&, Device*, stream_offset,
           BOOST_IOS::seekdir, BOOST_IOS::openmode, any_tag )
- { boost::throw_exception(cant_seek()); }
+ { boost::throw_exception(cant_seek());
+ BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
 
     template<typename Filter, typename Device>
     static std::streampos
@@ -253,7 +266,8 @@
     static std::streamsize
     write( Filter&, Sink*, const typename char_type_of<Filter>::type*,
            std::streamsize )
- { boost::throw_exception(cant_write()); }
+ { boost::throw_exception(cant_write());
+ BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
 };
 
 template<>
@@ -261,7 +275,8 @@
     template<typename Filter, typename Source>
     static std::streamsize
     read(Filter&, Source*, typename char_type_of<Filter>::type*,std::streamsize)
- { boost::throw_exception(cant_read()); }
+ { boost::throw_exception(cant_read());
+ BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) }
 
     template<typename Filter, typename Sink>
     static std::streamsize

Modified: branches/release/boost/iostreams/detail/is_dereferenceable.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/is_dereferenceable.hpp (original)
+++ branches/release/boost/iostreams/detail/is_dereferenceable.hpp 2010-01-08 00:40:59 EST (Fri, 08 Jan 2010)
@@ -49,10 +49,10 @@
 # endif
   
   // two check overloads help us identify which operator++ was picked
- char (& check(tag) )[2];
+ char (& check BOOST_PREVENT_MACRO_SUBSTITUTION(tag) )[2];
   
   template <class T>
- char check(T const&);
+ char check BOOST_PREVENT_MACRO_SUBSTITUTION(T const&);
   
   template <class T>
   struct impl
@@ -61,7 +61,7 @@
 
       BOOST_STATIC_CONSTANT(
           bool
- , value = sizeof(is_dereferenceable_::check(BOOST_comma(*x,0))) == 1
+ , value = sizeof(is_dereferenceable_::check BOOST_PREVENT_MACRO_SUBSTITUTION(BOOST_comma(*x,0))) == 1
       );
   };
 }

Modified: branches/release/boost/iostreams/filter/bzip2.hpp
==============================================================================
--- branches/release/boost/iostreams/filter/bzip2.hpp (original)
+++ branches/release/boost/iostreams/filter/bzip2.hpp 2010-01-08 00:40:59 EST (Fri, 08 Jan 2010)
@@ -113,7 +113,7 @@
 public:
     explicit bzip2_error(int error);
     int error() const { return error_; }
- static void check(int error);
+ static void check BOOST_PREVENT_MACRO_SUBSTITUTION(int error);
 private:
     int error_;
 };
@@ -316,7 +316,7 @@
     before(src_begin, src_end, dest_begin, dest_end);
     int result = compress(flush ? bzip2::finish : bzip2::run);
     after(src_begin, dest_begin);
- bzip2_error::check(result);
+ bzip2_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result);
     return result != bzip2::stream_end;
 }
 
@@ -348,7 +348,7 @@
     before(src_begin, src_end, dest_begin, dest_end);
     int result = decompress();
     after(src_begin, dest_begin);
- bzip2_error::check(result);
+ bzip2_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result);
     return !(eof_ = result == bzip2::stream_end);
 }
 

Modified: branches/release/boost/iostreams/filter/zlib.hpp
==============================================================================
--- branches/release/boost/iostreams/filter/zlib.hpp (original)
+++ branches/release/boost/iostreams/filter/zlib.hpp 2010-01-08 00:40:59 EST (Fri, 08 Jan 2010)
@@ -139,7 +139,7 @@
 public:
     explicit zlib_error(int error);
     int error() const { return error_; }
- static void check(int error);
+ static void check BOOST_PREVENT_MACRO_SUBSTITUTION(int error);
 private:
     int error_;
 };
@@ -345,7 +345,7 @@
     before(src_begin, src_end, dest_begin, dest_end);
     int result = xdeflate(flush ? zlib::finish : zlib::no_flush);
     after(src_begin, dest_begin, true);
- zlib_error::check(result);
+ zlib_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result);
     return result != zlib::stream_end;
 }
 
@@ -378,7 +378,7 @@
     before(src_begin, src_end, dest_begin, dest_end);
     int result = xinflate(zlib::sync_flush);
     after(src_begin, dest_begin, false);
- zlib_error::check(result);
+ zlib_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result);
     return result != zlib::stream_end;
 }
 

Modified: branches/release/libs/iostreams/src/bzip2.cpp
==============================================================================
--- branches/release/libs/iostreams/src/bzip2.cpp (original)
+++ branches/release/libs/iostreams/src/bzip2.cpp 2010-01-08 00:40:59 EST (Fri, 08 Jan 2010)
@@ -56,7 +56,7 @@
     : BOOST_IOSTREAMS_FAILURE("bzip2 error"), error_(error)
     { }
 
-void bzip2_error::check(int error)
+void bzip2_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(int error)
 {
     switch (error) {
     case BZ_OK:
@@ -103,7 +103,7 @@
 {
     ready_ = false;
     bz_stream* s = static_cast<bz_stream*>(stream_);
- bzip2_error::check(
+ bzip2_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(
         compress ?
             BZ2_bzCompressEnd(s) :
             BZ2_bzDecompressEnd(s)
@@ -140,7 +140,7 @@
         s->bzfree = 0;
     //#endif
     s->opaque = derived;
- bzip2_error::check(
+ bzip2_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(
         compress ?
             BZ2_bzCompressInit( s,
                                 params_.block_size,

Deleted: branches/release/libs/iostreams/src/file_times.cpp
==============================================================================
--- branches/release/libs/iostreams/src/file_times.cpp 2010-01-08 00:40:59 EST (Fri, 08 Jan 2010)
+++ (empty file)
@@ -1 +0,0 @@
-#error "This file needs to be removed from subversion."

Modified: branches/release/libs/iostreams/src/zlib.cpp
==============================================================================
--- branches/release/libs/iostreams/src/zlib.cpp (original)
+++ branches/release/libs/iostreams/src/zlib.cpp 2010-01-08 00:40:59 EST (Fri, 08 Jan 2010)
@@ -71,7 +71,7 @@
     : BOOST_IOSTREAMS_FAILURE("zlib error"), error_(error)
     { }
 
-void zlib_error::check(int error)
+void zlib_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(int error)
 {
     switch (error) {
     case Z_OK:
@@ -144,7 +144,7 @@
     z_stream* s = static_cast<z_stream*>(stream_);
     // Undiagnosed bug:
     // deflateReset(), etc., return Z_DATA_ERROR
- //zlib_error::check(
+ //zlib_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(
         realloc ?
             (compress ? deflateReset(s) : inflateReset(s)) :
             (compress ? deflateEnd(s) : inflateEnd(s))
@@ -173,7 +173,7 @@
     //#endif
     s->opaque = derived;
     int window_bits = p.noheader? -p.window_bits : p.window_bits;
- zlib_error::check(
+ zlib_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(
         compress ?
             deflateInit2( s,
                           p.level,


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