зеркало из https://github.com/mozilla/gecko-dev.git
Bug 924012 - Provide a HashString version for char16_t if needed; r=Waldo
This commit is contained in:
Родитель
b7844a297e
Коммит
763b16b0a6
|
@ -48,6 +48,7 @@
|
|||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Char16.h"
|
||||
#include "mozilla/Types.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
@ -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!
|
||||
|
|
Загрузка…
Ссылка в новой задаче