[Libreoffice-commits] .: sal/inc sal/qa
Lubos Lunak
llunak at kemper.freedesktop.org
Wed Mar 28 14:40:28 PDT 2012
sal/inc/rtl/strbuf.hxx | 14 ++++++++++++++
sal/qa/rtl/strings/test_ostring_stringliterals.cxx | 4 ++++
2 files changed, 18 insertions(+)
New commits:
commit c9167bac18e1cca061d91f65d2dc91b9d09ef587
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Wed Mar 28 23:38:58 2012 +0200
gcc-4.0.1 SFINAE workarounds
diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 54428d3..122eb4b 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -373,6 +373,12 @@ public:
@param str the characters to be appended.
@return this string buffer.
*/
+#ifdef HAVE_SFINAE_ANONYMOUS_BROKEN
+ OStringBuffer & append( const sal_Char * str )
+ {
+ return append( str, rtl_str_getLength( str ) );
+ }
+#else
template< typename T >
typename internal::CharPtrDetector< T, OStringBuffer& >::Type append( const T& str )
{
@@ -397,6 +403,7 @@ public:
rtl_stringbuffer_insert( &pData, &nCapacity, getLength(), literal, internal::ConstCharArrayDetector< T, void >::size - 1 );
return *this;
}
+#endif
/**
Appends the string representation of the <code>char</code> array
@@ -555,6 +562,12 @@ public:
@param str a character array.
@return this string buffer.
*/
+#ifdef HAVE_SFINAE_ANONYMOUS_BROKEN
+ OStringBuffer & insert( sal_Int32 offset, const sal_Char * str )
+ {
+ return insert( offset, str, rtl_str_getLength( str ) );
+ }
+#else
template< typename T >
typename internal::CharPtrDetector< T, OStringBuffer& >::Type insert( sal_Int32 offset, const T& str )
{
@@ -579,6 +592,7 @@ public:
rtl_stringbuffer_insert( &pData, &nCapacity, offset, literal, internal::ConstCharArrayDetector< T, void >::size - 1 );
return *this;
}
+#endif
/**
Inserts the string representation of the <code>char</code> array
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 3f2ed84..494c1da 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -257,6 +257,7 @@ void test::ostring::StringLiterals::checkNonConstUsage()
void test::ostring::StringLiterals::checkBuffer()
{
rtl::OStringBuffer buf;
+#ifndef HAVE_SFINAE_ANONYMOUS_BROKEN
rtl_string_unittest_const_literal_function = false;
buf.append( "foo" );
CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
@@ -269,6 +270,9 @@ void test::ostring::StringLiterals::checkBuffer()
buf.insert( 3, "baz" );
CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OString( "foobazbar" ));
+#else
+ buf.append( "foobazbar" );
+#endif
rtl::OString foobazbard( "foobazbard" );
rtl::OString foodbazbard( "foodbazbard" );
More information about the Libreoffice-commits
mailing list