Commit 830711e7 authored by Volker Krause's avatar Volker Krause
Browse files

Work around bool and jboolean being different types

We fail to read bool properties otherwise. This still needs a better
solution eventually, with some form of C++ types <-> JNI basic types
mapping maybe.
parent 5ad7d609
......@@ -72,7 +72,8 @@ struct JniSignature
};
template <> struct JniSignature<bool> { constexpr inline auto operator()() const { return StaticString<'Z'>(); } };
template <> struct JniSignature<uint8_t> { constexpr inline auto operator()() const { return StaticString<'B'>(); } };
template <> struct JniSignature<jboolean> { constexpr inline auto operator()() const { return StaticString<'Z'>(); } };
template <> struct JniSignature<jbyte> { constexpr inline auto operator()() const { return StaticString<'B'>(); } };
template <> struct JniSignature<char> { constexpr inline auto operator()() const { return StaticString<'C'>(); } };
template <> struct JniSignature<short> { constexpr inline auto operator()() const { return StaticString<'S'>(); } };
template <> struct JniSignature<int> { constexpr inline auto operator()() const { return StaticString<'I'>(); } };
......
......@@ -24,6 +24,7 @@ template <typename T> class Array;
*/
template <typename T> struct is_basic_type : std::false_type {};
template <> struct is_basic_type<bool> : std::true_type {};
template <> struct is_basic_type<jboolean> : std::true_type {};
template <> struct is_basic_type<jbyte> : std::true_type {};
template <> struct is_basic_type<jchar> : std::true_type {};
template <> struct is_basic_type<jshort> : std::true_type {};
......
Supports Markdown
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