diff options
Diffstat (limited to 'src/corelib/kernel/qjnitypes.h')
-rw-r--r-- | src/corelib/kernel/qjnitypes.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/kernel/qjnitypes.h b/src/corelib/kernel/qjnitypes.h index 1eaae6312b..033445be6a 100644 --- a/src/corelib/kernel/qjnitypes.h +++ b/src/corelib/kernel/qjnitypes.h @@ -11,6 +11,7 @@ QT_BEGIN_NAMESPACE +// QT_TECH_PREVIEW_API #define Q_DECLARE_JNI_TYPE_HELPER(Type) \ namespace QtJniTypes { \ struct Type : JObject<Type> \ @@ -19,19 +20,19 @@ struct Type : JObject<Type> \ }; \ } \ - +// QT_TECH_PREVIEW_API #define Q_DECLARE_JNI_TYPE(Type, Signature) \ Q_DECLARE_JNI_TYPE_HELPER(Type) \ template<> \ struct QtJniTypes::Traits<QtJniTypes::Type> { \ static constexpr auto signature() \ { \ - static_assert((Signature[0] == 'L' \ - || Signature[0] == '[') \ - && Signature[sizeof(Signature) - 2] == ';', \ + constexpr QtJniTypes::CTString sig(Signature); \ + static_assert((sig.startsWith('L') || sig.startsWith("[L")) \ + && sig.endsWith(';'), \ "Type signature needs to start with 'L' or" \ - " '[' and end with ';'"); \ - return QtJniTypes::CTString(Signature); \ + " '[L', and end with ';'"); \ + return sig; \ } \ }; \ @@ -176,7 +177,6 @@ va_##Method(JNIEnv *env, jclass thiz, ...) }, argTuple); \ } \ - #define Q_DECLARE_JNI_NATIVE_METHOD(...) \ QT_OVERLOADED_MACRO(QT_DECLARE_JNI_NATIVE_METHOD, __VA_ARGS__) \ |