diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-03-28 23:38:58 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-03-28 23:40:10 +0200 |
commit | c9167bac18e1cca061d91f65d2dc91b9d09ef587 (patch) | |
tree | 9cd555b5d0ead796fd711442815374c21ad0e3e5 | |
parent | b9f7225bb7c9cb58f796296fac3e58f84a619303 (diff) |
gcc-4.0.1 SFINAE workarounds
-rw-r--r-- | sal/inc/rtl/strbuf.hxx | 14 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_ostring_stringliterals.cxx | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx index 54428d340a10..122eb4b099e6 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 3f2ed8465815..494c1da5497e 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" ); |