From e21d35b9f78d9946de3c9b7d23a19e628182a9d8 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 31 Oct 2023 11:28:51 +0800 Subject: JNI: don't implement a signature for 'long' C++ type On Android, `long` has the width of the system, while `jlong` is always 64 bit. If we support `long` as a signature type equivalent to `jlong`, then it becomes possible to write code that fails to compile, or in the worst case crashes at runtime, on a 32bit system. Instead, support quint64, which is always the same size as jlong. Change-Id: I60432ec7411e697b5f6e1f153216ceee0af7e0f1 Reviewed-by: Assam Boudjelthia --- tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/corelib/kernel') diff --git a/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp b/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp index f9d9a4c13c..58fd6790c1 100644 --- a/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp +++ b/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp @@ -137,7 +137,7 @@ enum class IntEnum : int {}; enum class UnsignedEnum : unsigned {}; enum class Int8Enum : int8_t {}; enum class ShortEnum : short {}; -enum class LongEnum : long {}; +enum class LongEnum : quint64 {}; enum class JIntEnum : jint {}; static_assert(QtJniTypes::Traits::signature() == "I"); @@ -153,7 +153,7 @@ void tst_QJniTypes::initTestCase() } -static bool nativeFunction(JNIEnv *, jclass, int, jstring, long) +static bool nativeFunction(JNIEnv *, jclass, int, jstring, quint64) { return true; } -- cgit v1.2.3