diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-10-31 11:28:51 +0800 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-11-01 15:58:40 +0800 |
commit | e21d35b9f78d9946de3c9b7d23a19e628182a9d8 (patch) | |
tree | 5f5507f23b919a7a1df27f735370ea0494aa0972 /tests/auto/corelib/kernel | |
parent | 45c6ef02e7e730f7a0c7b5bccd96c4f9ca74e1a6 (diff) |
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 <assam.boudjelthia@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel')
-rw-r--r-- | tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<UnscopedEnum>::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; } |