From f3e099960a97c4f8ae50230449a9c413e6851618 Mon Sep 17 00:00:00 2001 From: Guillaume Munch Date: Fri, 23 Sep 2016 01:42:57 +0200 Subject: [PATCH] Gcc 4.6 compatibility :( --- src/TexRow.h | 10 ++++++++++ src/texstream.cpp | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/TexRow.h b/src/TexRow.h index 3ca51724f8..382d566a76 100644 --- a/src/TexRow.h +++ b/src/TexRow.h @@ -89,6 +89,7 @@ public: /// TexRow(); +#if !(defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) /// Copy can be expensive and is not usually useful for TexRow. /// Force explicit copy, prefer move instead. This also prevents /// move()s from being converted into copy silently. @@ -96,6 +97,10 @@ public: TexRow(TexRow && other) = default; TexRow & operator=(TexRow const & other) = default; TexRow & operator=(TexRow && other) = default; +# else + //for gcc 4.6, nothing to do: it's enough to disable implicit copy during + // dev with more recent versions of gcc. +#endif /// Clears structure. void reset(); @@ -204,6 +209,7 @@ struct TexString { docstring str; /// TexRow texrow; +#if !(defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)) /// Copy can be expensive and is not usually useful for TexString. /// Force explicit copy, prefer move instead. This also prevents /// move()s from being converted into copy silently. @@ -211,6 +217,10 @@ struct TexString { TexString(TexString && other) = default; TexString & operator=(TexString const & other) = default; TexString & operator=(TexString && other) = default; +# else + //for gcc 4.6, nothing to do: it's enough to disable implicit copy during + // dev with more recent versions of gcc. +#endif /// TexString() = default; /// ensure that the string and the TexRow have as many newlines. diff --git a/src/texstream.cpp b/src/texstream.cpp index be1168a7e8..eb1834b5de 100644 --- a/src/texstream.cpp +++ b/src/texstream.cpp @@ -80,7 +80,8 @@ TexString otexstringstream::release() { TexString ts{ods_.str(), TexRow()}; swap(ts.texrow, texrow()); - ods_ = odocstringstream(); + ods_.clear(); + ods_.str(docstring()); return ts; } -- 2.39.2