[Libreoffice-commits] .: sal/inc sal/qa
Lubos Lunak
llunak at kemper.freedesktop.org
Wed Mar 28 08:52:37 PDT 2012
sal/inc/rtl/string.hxx | 7 +++++++
sal/qa/rtl/strings/test_ostring_stringliterals.cxx | 2 ++
2 files changed, 9 insertions(+)
New commits:
commit 86a1e6de4fc3af897271bc5f7f04506261d4f286
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Wed Mar 28 17:37:19 2012 +0200
SFINAE workarounds for gcc-4.0.1
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 39414e6..68f41bd 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -551,6 +551,12 @@ public:
@return sal_True if the strings are equal;
sal_False, otherwise.
*/
+#ifdef HAVE_SFINAE_ANONYMOUS_BROKEN
+ sal_Bool equalsIgnoreAsciiCase( const sal_Char * asciiStr ) const SAL_THROW(())
+ {
+ return rtl_str_compareIgnoreAsciiCase( pData->buffer, asciiStr ) == 0;
+ }
+#else
template< typename T >
typename internal::CharPtrDetector< T, bool >::Type equalsIgnoreAsciiCase( const T& asciiStr ) const SAL_THROW(())
{
@@ -577,6 +583,7 @@ public:
return rtl_str_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length,
literal, internal::ConstCharArrayDetector< T, void >::size - 1 ) == 0;
}
+#endif
/**
Perform a ASCII lowercase comparison of two strings.
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 4af152c..930b038 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -152,9 +152,11 @@ void test::ostring::StringLiterals::checkUsage()
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT_EQUAL( foo, rtl::OString() = "foo" );
CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+#ifndef HAVE_SFINAE_ANONYMOUS_BROKEN
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( FoO.equalsIgnoreAsciiCase( "fOo" ));
CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+#endif
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobarfoo.match( "bar", 3 ));
CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
More information about the Libreoffice-commits
mailing list