diff --git a/mfbt/HashFunctions.h b/mfbt/HashFunctions.h index 6d0d24e7b1c8..b228955ce5bb 100644 --- a/mfbt/HashFunctions.h +++ b/mfbt/HashFunctions.h @@ -48,6 +48,7 @@ #include "mozilla/Assertions.h" #include "mozilla/Attributes.h" +#include "mozilla/Char16.h" #include "mozilla/Types.h" #include @@ -326,6 +327,22 @@ HashString(const uint16_t* str, size_t length) return detail::HashKnownLength(str, length); } +#ifdef MOZ_CHAR16_IS_NOT_WCHAR +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashString(const char16_t* str) +{ + return detail::HashUntilZero(str); +} + +MOZ_WARN_UNUSED_RESULT +inline uint32_t +HashString(const char16_t* str, size_t length) +{ + return detail::HashKnownLength(str, length); +} +#endif + /* * On Windows, wchar_t (PRUnichar) is not the same as uint16_t, even though it's * the same width!