From: Guillaume Munch Date: Thu, 22 Sep 2016 23:42:57 +0000 (+0200) Subject: Gcc 4.6 compatibility :( X-Git-Tag: 2.3.0alpha1~879 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f3e099960a97c4f8ae50230449a9c413e6851618;p=features.git Gcc 4.6 compatibility :( --- 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; }