void-packages/srcpkgs/mame/patches/fix-std_istream_swap.patch
2016-08-31 09:58:45 +02:00

66 lines
2.8 KiB
Diff

The template swap() implementation does not compile with gcc-4.9.4,
but fortunately it is not yet used anywhere in the code, thus just
rip it out.
--- src/lib/util/vecstream.h 2016-08-31 03:47:01.000000000 +0200
+++ src/lib/util/vecstream.h 2016-08-31 08:46:11.374477157 +0200
@@ -107,15 +107,6 @@
setup();
}
- void swap(basic_vectorbuf &that)
- {
- using std::swap;
- std::basic_streambuf<CharT, Traits>::swap(that);
- swap(m_mode, that.m_mode);
- swap(m_storage, that.m_storage);
- swap(m_threshold, that.m_threshold);
- }
-
void reserve(typename vector_type::size_type size)
{
if ((m_mode & std::ios_base::out) && (m_storage.capacity() < size))
@@ -327,8 +318,6 @@
void vec(const vector_type &content) { rdbuf()->vec(content); }
void vec(vector_type &&content) { rdbuf()->vec(std::move(content)); }
- void swap(basic_ivectorstream &that) { std::basic_istream<CharT, Traits>::swap(that); rdbuf()->swap(*that.rdbuf()); }
-
private:
basic_vectorbuf<CharT, Traits, Allocator> m_rdbuf;
};
@@ -350,8 +339,6 @@
void vec(vector_type &&content) { rdbuf()->vec(std::move(content)); }
basic_ovectorstream &reserve(typename vector_type::size_type size) { rdbuf()->reserve(size); return *this; }
- void swap(basic_ovectorstream &that) { std::basic_ostream<CharT, Traits>::swap(that); rdbuf()->swap(*that.rdbuf()); }
-
private:
basic_vectorbuf<CharT, Traits, Allocator> m_rdbuf;
};
@@ -373,8 +360,6 @@
void vec(vector_type &&content) { rdbuf()->vec(std::move(content)); }
basic_vectorstream &reserve(typename vector_type::size_type size) { rdbuf()->reserve(size); return *this; }
- void swap(basic_vectorstream &that) { std::basic_iostream<CharT, Traits>::swap(that); rdbuf()->swap(*that.rdbuf()); }
-
private:
basic_vectorbuf<CharT, Traits, Allocator> m_rdbuf;
};
@@ -386,16 +371,6 @@
typedef basic_vectorstream<char> vectorstream;
typedef basic_vectorstream<wchar_t> wvectorstream;
-template <typename CharT, typename Traits, typename Allocator>
-void swap(basic_vectorbuf<CharT, Traits, Allocator> &a, basic_vectorbuf<CharT, Traits, Allocator> &b) { a.swap(b); }
-
-template <typename CharT, typename Traits, typename Allocator>
-void swap(basic_ivectorstream<CharT, Traits, Allocator> &a, basic_ivectorstream<CharT, Traits, Allocator> &b) { a.swap(b); }
-template <typename CharT, typename Traits, typename Allocator>
-void swap(basic_ovectorstream<CharT, Traits, Allocator> &a, basic_ovectorstream<CharT, Traits, Allocator> &b) { a.swap(b); }
-template <typename CharT, typename Traits, typename Allocator>
-void swap(basic_vectorstream<CharT, Traits, Allocator> &a, basic_vectorstream<CharT, Traits, Allocator> &b) { a.swap(b); }
-
extern template class basic_ivectorstream<char>;
extern template class basic_ivectorstream<wchar_t>;
extern template class basic_ovectorstream<char>;