Commit 342062ee authored by Aleksey Konovalov's avatar Aleksey Konovalov

check the representation of wchar_t only if they're used

parent fe000c8d
...@@ -479,7 +479,10 @@ std::string jniUTF8FromString(JNIEnv * env, const jstring jstr) { ...@@ -479,7 +479,10 @@ std::string jniUTF8FromString(JNIEnv * env, const jstring jstr) {
} }
template<int wcharTypeSize> template<int wcharTypeSize>
static std::wstring implUTF16ToWString(const char16_t * data, size_t length); static std::wstring implUTF16ToWString(const char16_t * data, size_t length)
{
static_assert(wcharTypeSize == 2 || wcharTypeSize == 4, "wchar_t must be represented by UTF-16 or UTF-32 encoding");
}
template<> template<>
inline std::wstring implUTF16ToWString<2>(const char16_t * data, size_t length) { inline std::wstring implUTF16ToWString<2>(const char16_t * data, size_t length) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment