Fix for windows bustage from bug 559489
authorSimon Montagu <smontagu@smontagu.org>
Sun, 04 Jul 2010 16:27:16 +0300
changeset 47212 846890403c24a28ed5f6dd4c80247f249197758d
parent 47211 4a6b283ec78cdeb50368c7ebf957079a82cc9f66
child 47213 0e6c8cf26d7d9c885b7dc265b6f791d6caaf433c
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs559489
milestone2.0b2pre
Fix for windows bustage from bug 559489
intl/unicharutil/util/nsUnicharUtils.cpp
intl/unicharutil/util/nsUnicharUtils.h
--- a/intl/unicharutil/util/nsUnicharUtils.cpp
+++ b/intl/unicharutil/util/nsUnicharUtils.cpp
@@ -168,16 +168,32 @@ nsCaseInsensitiveStringComparator::opera
   if (lhs == rhs)
     return 0;
   else if (lhs < rhs)
     return -1;
   else
     return 1;
 }
 
+#else // MOZILLA_INTERNAL_API
+
+PRInt32
+CaseInsensitiveCompare(const PRUnichar *a,
+                       const PRUnichar *b,
+                       PRUint32 len)
+{
+  nsICaseConversion* caseConv = NS_GetCaseConversion();
+  if (!caseConv)
+    return NS_strcmp(a, b);
+
+  PRInt32 result;
+  caseConv->CaseInsensitiveCompare(a, b, len, &result);
+  return result;
+}
+
 #endif // MOZILLA_INTERNAL_API
 
 PRUnichar
 ToLowerCase(PRUnichar aChar)
 {
   PRUnichar result;
   nsICaseConversion* caseConv = NS_GetCaseConversion();
   if (caseConv)
--- a/intl/unicharutil/util/nsUnicharUtils.h
+++ b/intl/unicharutil/util/nsUnicharUtils.h
@@ -102,11 +102,16 @@ CaseInsensitiveFindInReadable(const nsAS
                               const nsAString& aHay)
 {
   nsAString::const_iterator searchBegin, searchEnd;
   return FindInReadable(aPattern, aHay.BeginReading(searchBegin),
                         aHay.EndReading(searchEnd),
                         nsCaseInsensitiveStringComparator());
 }
 
+#else // MOZILLA_INTERNAL_API
+
+NS_HIDDEN_(PRInt32)
+CaseInsensitiveCompare(const PRUnichar *a, const PRUnichar *b, PRUint32 len);
+
 #endif // MOZILLA_INTERNAL_API
 
 #endif  /* nsUnicharUtils_h__ */