Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ if(APPLE)
message(STATUS "Configure macos platform module")
endif()


if (UNIX AND NOT APPLE)
add_subdirectory(linux)
message(STATUS "Configure linux platform module")
endif()
endif()
6 changes: 4 additions & 2 deletions shared/cc/StringUTF16.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ jwm::StringUTF16::StringUTF16(const uint32_t *str) {
}

jwm::JNILocal<jstring> jwm::StringUTF16::toJString(JNIEnv* env) const {
return jwm::JNILocal<jstring>(env, env->NewString(c_str(), static_cast<jsize>(length())));
return jwm::JNILocal<jstring>(env, env->NewString(reinterpret_cast<const jchar*>(c_str()), static_cast<jsize>(length())));
}

jwm::StringUTF16 jwm::StringUTF16::makeFromJString(JNIEnv* env, jstring js) {
jwm::StringUTF16 result;
jsize length = env->GetStringLength(js);
const jchar* chars = env->GetStringChars(js, nullptr);
result = jwm::StringUTF16(chars, length);

const char16_t* signed_chars = reinterpret_cast<const char16_t*>(chars);
result = jwm::StringUTF16(signed_chars, length);
env->ReleaseStringChars(js, chars);
return result;
}
Expand Down
4 changes: 2 additions & 2 deletions shared/cc/StringUTF16.hh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ namespace jwm
/**
* @brief std::string which uses jchar as a character type
*/
class StringUTF16: public std::basic_string<jchar> {
class StringUTF16: public std::basic_string<char16_t> {
public:
using std::basic_string<jchar>::basic_string;
using std::basic_string<char16_t>::basic_string;

/**
* Constructs StringUTF16 from C style string.
Expand Down
Loading