summaryrefslogtreecommitdiff
path: root/boost/iostreams
diff options
context:
space:
mode:
Diffstat (limited to 'boost/iostreams')
-rw-r--r--boost/iostreams/detail/buffer.hpp28
-rw-r--r--boost/iostreams/detail/config/fpos.hpp2
-rw-r--r--boost/iostreams/filter/bzip2.hpp8
-rw-r--r--boost/iostreams/filter/lzma.hpp8
-rw-r--r--boost/iostreams/filter/zlib.hpp8
-rw-r--r--boost/iostreams/filtering_stream.hpp21
-rw-r--r--boost/iostreams/stream.hpp20
7 files changed, 92 insertions, 3 deletions
diff --git a/boost/iostreams/detail/buffer.hpp b/boost/iostreams/detail/buffer.hpp
index 72400f04ca..35cb33c700 100644
--- a/boost/iostreams/detail/buffer.hpp
+++ b/boost/iostreams/detail/buffer.hpp
@@ -39,10 +39,16 @@ template< typename Ch,
class basic_buffer {
private:
#ifndef BOOST_NO_STD_ALLOCATOR
+#if defined(BOOST_NO_CXX11_ALLOCATOR)
typedef typename Alloc::template rebind<Ch>::other allocator_type;
#else
+ typedef typename std::allocator_traits<Alloc>::template rebind_alloc<Ch> allocator_type;
+ typedef std::allocator_traits<allocator_type> allocator_traits;
+#endif
+#else
typedef std::allocator<Ch> allocator_type;
#endif
+ static Ch* allocate(std::streamsize buffer_size);
public:
basic_buffer();
basic_buffer(std::streamsize buffer_size);
@@ -145,9 +151,21 @@ template<typename Ch, typename Alloc>
basic_buffer<Ch, Alloc>::basic_buffer() : buf_(0), size_(0) { }
template<typename Ch, typename Alloc>
+inline Ch* basic_buffer<Ch, Alloc>::allocate(std::streamsize buffer_size)
+{
+#if defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_STD_ALLOCATOR)
+ return static_cast<Ch*>(allocator_type().allocate(
+ static_cast<BOOST_DEDUCED_TYPENAME Alloc::size_type>(buffer_size), 0));
+#else
+ allocator_type alloc;
+ return static_cast<Ch*>(allocator_traits::allocate(alloc,
+ static_cast<BOOST_DEDUCED_TYPENAME allocator_traits::size_type>(buffer_size)));
+#endif
+}
+
+template<typename Ch, typename Alloc>
basic_buffer<Ch, Alloc>::basic_buffer(std::streamsize buffer_size)
- : buf_(static_cast<Ch*>(allocator_type().allocate(
- static_cast<BOOST_DEDUCED_TYPENAME Alloc::size_type>(buffer_size), 0))),
+ : buf_(allocate(buffer_size)),
size_(buffer_size) // Cast for SunPro 5.3.
{ }
@@ -155,8 +173,14 @@ template<typename Ch, typename Alloc>
inline basic_buffer<Ch, Alloc>::~basic_buffer()
{
if (buf_) {
+#if defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_STD_ALLOCATOR)
allocator_type().deallocate(buf_,
static_cast<BOOST_DEDUCED_TYPENAME Alloc::size_type>(size_));
+#else
+ allocator_type alloc;
+ allocator_traits::deallocate(alloc, buf_,
+ static_cast<BOOST_DEDUCED_TYPENAME allocator_traits::size_type>(size_));
+#endif
}
}
diff --git a/boost/iostreams/detail/config/fpos.hpp b/boost/iostreams/detail/config/fpos.hpp
index de8bdb84aa..12c13a0f1e 100644
--- a/boost/iostreams/detail/config/fpos.hpp
+++ b/boost/iostreams/detail/config/fpos.hpp
@@ -25,7 +25,7 @@
#include <boost/config.hpp>
# if (defined(_YVALS) || defined(_CPPLIB_VER)) && !defined(__SGI_STL_PORT) && \
- !defined(_STLPORT_VERSION) && !defined(__QNX__) && !defined(_VX_CPU)
+ !defined(_STLPORT_VERSION) && !defined(__QNX__) && !defined(_VX_CPU) && !defined(__VXWORKS__)
/**/
#include <boost/iostreams/detail/ios.hpp>
diff --git a/boost/iostreams/filter/bzip2.hpp b/boost/iostreams/filter/bzip2.hpp
index 029338d1c6..b9c04a7ce1 100644
--- a/boost/iostreams/filter/bzip2.hpp
+++ b/boost/iostreams/filter/bzip2.hpp
@@ -123,8 +123,12 @@ namespace detail {
template<typename Alloc>
struct bzip2_allocator_traits {
#ifndef BOOST_NO_STD_ALLOCATOR
+#if defined(BOOST_NO_CXX11_ALLOCATOR)
typedef typename Alloc::template rebind<char>::other type;
#else
+ typedef typename std::allocator_traits<Alloc>::template rebind_alloc<char> type;
+#endif
+#else
typedef std::allocator<char> type;
#endif
};
@@ -134,7 +138,11 @@ template< typename Alloc,
BOOST_DEDUCED_TYPENAME bzip2_allocator_traits<Alloc>::type >
struct bzip2_allocator : private Base {
private:
+#if defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_STD_ALLOCATOR)
typedef typename Base::size_type size_type;
+#else
+ typedef typename std::allocator_traits<Base>::size_type size_type;
+#endif
public:
BOOST_STATIC_CONSTANT(bool, custom =
(!is_same<std::allocator<char>, Base>::value));
diff --git a/boost/iostreams/filter/lzma.hpp b/boost/iostreams/filter/lzma.hpp
index f15f6794a7..94cd2b3b54 100644
--- a/boost/iostreams/filter/lzma.hpp
+++ b/boost/iostreams/filter/lzma.hpp
@@ -112,8 +112,12 @@ namespace detail {
template<typename Alloc>
struct lzma_allocator_traits {
#ifndef BOOST_NO_STD_ALLOCATOR
+#if defined(BOOST_NO_CXX11_ALLOCATOR)
typedef typename Alloc::template rebind<char>::other type;
#else
+ typedef typename std::allocator_traits<Alloc>::template rebind_alloc<char> type;
+#endif
+#else
typedef std::allocator<char> type;
#endif
};
@@ -123,7 +127,11 @@ template< typename Alloc,
BOOST_DEDUCED_TYPENAME lzma_allocator_traits<Alloc>::type >
struct lzma_allocator : private Base {
private:
+#if defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_STD_ALLOCATOR)
typedef typename Base::size_type size_type;
+#else
+ typedef typename std::allocator_traits<Base>::size_type size_type;
+#endif
public:
BOOST_STATIC_CONSTANT(bool, custom =
(!is_same<std::allocator<char>, Base>::value));
diff --git a/boost/iostreams/filter/zlib.hpp b/boost/iostreams/filter/zlib.hpp
index 3d0de14a70..e57870a510 100644
--- a/boost/iostreams/filter/zlib.hpp
+++ b/boost/iostreams/filter/zlib.hpp
@@ -149,8 +149,12 @@ namespace detail {
template<typename Alloc>
struct zlib_allocator_traits {
#ifndef BOOST_NO_STD_ALLOCATOR
+#if defined(BOOST_NO_CXX11_ALLOCATOR)
typedef typename Alloc::template rebind<char>::other type;
#else
+ typedef typename std::allocator_traits<Alloc>::template rebind_alloc<char> type;
+#endif
+#else
typedef std::allocator<char> type;
#endif
};
@@ -160,7 +164,11 @@ template< typename Alloc,
BOOST_DEDUCED_TYPENAME zlib_allocator_traits<Alloc>::type >
struct zlib_allocator : private Base {
private:
+#if defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_STD_ALLOCATOR)
typedef typename Base::size_type size_type;
+#else
+ typedef typename std::allocator_traits<Base>::size_type size_type;
+#endif
public:
BOOST_STATIC_CONSTANT(bool, custom =
(!is_same<std::allocator<char>, Base>::value));
diff --git a/boost/iostreams/filtering_stream.hpp b/boost/iostreams/filtering_stream.hpp
index 3279c590cf..8621ef96b2 100644
--- a/boost/iostreams/filtering_stream.hpp
+++ b/boost/iostreams/filtering_stream.hpp
@@ -62,6 +62,12 @@ struct filtering_stream_traits {
>::type stream_tag;
};
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
+# pragma warning(push)
+// https://connect.microsoft.com/VisualStudio/feedback/details/733720/
+# pragma warning(disable: 4250)
+#endif
+
template<typename Chain, typename Access>
class filtering_stream_base
: public access_control<
@@ -93,6 +99,10 @@ private:
Chain chain_;
};
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
+# pragma warning(pop)
+#endif
+
} // End namespace detail.
//
@@ -149,9 +159,20 @@ private:
{ client_type::push(t BOOST_IOSTREAMS_PUSH_ARGS()); } \
}; \
/**/
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
+# pragma warning(push)
+// https://connect.microsoft.com/VisualStudio/feedback/details/733720/
+# pragma warning(disable: 4250)
+#endif
+
BOOST_IOSTREAMS_DEFINE_FILTER_STREAM(filtering_stream, boost::iostreams::chain, char)
BOOST_IOSTREAMS_DEFINE_FILTER_STREAM(wfiltering_stream, boost::iostreams::chain, wchar_t)
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
+# pragma warning(pop)
+#endif
+
typedef filtering_stream<input> filtering_istream;
typedef filtering_stream<output> filtering_ostream;
typedef wfiltering_stream<input> filtering_wistream;
diff --git a/boost/iostreams/stream.hpp b/boost/iostreams/stream.hpp
index f706288eae..c581837b75 100644
--- a/boost/iostreams/stream.hpp
+++ b/boost/iostreams/stream.hpp
@@ -56,6 +56,12 @@ struct stream_traits {
>::type stream_tag;
};
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
+# pragma warning(push)
+// https://connect.microsoft.com/VisualStudio/feedback/details/733720/
+# pragma warning(disable: 4250)
+#endif
+
// By encapsulating initialization in a base, we can define the macro
// BOOST_IOSTREAMS_DEFINE_FORWARDING_FUNCTIONS to generate constructors
// without base member initializer lists.
@@ -84,6 +90,10 @@ public:
stream_base() : pbase_type(), stream_type(&member) { }
};
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
+# pragma warning(pop)
+#endif
+
} } } // End namespaces detail, iostreams, boost.
#ifdef BOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION
@@ -92,6 +102,12 @@ public:
namespace boost { namespace iostreams {
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
+# pragma warning(push)
+// https://connect.microsoft.com/VisualStudio/feedback/details/733720/
+# pragma warning(disable: 4250)
+#endif
+
//
// Template name: stream.
// Description: A iostream which reads from and writes to an instance of a
@@ -144,6 +160,10 @@ private:
}
};
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
+# pragma warning(pop)
+#endif
+
} } // End namespaces iostreams, boost.
#endif // #ifdef BOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION