diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-03-28 17:37:19 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-03-28 17:51:58 +0200 |
commit | 86a1e6de4fc3af897271bc5f7f04506261d4f286 (patch) | |
tree | 5bf829e4523221530fe571bfb6e9b9063b98c2b0 /sal | |
parent | remove static OUStrings from static_initialization_and_destruction chain (diff) | |
download | core-86a1e6de4fc3af897271bc5f7f04506261d4f286.tar.gz core-86a1e6de4fc3af897271bc5f7f04506261d4f286.zip |
SFINAE workarounds for gcc-4.0.1
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/rtl/string.hxx | 7 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_ostring_stringliterals.cxx | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 39414e64628c..68f41bdf6398 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 4af152c4f7c7..930b038a8447 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 ); |