From 65d781758c3d94e1c7caed603f22076c5ec10086 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Wed, 29 Mar 2023 13:29:08 +0000 Subject: [PATCH] Native: fix objc_direct tests on platforms with 32-bit `NSUInteger` On some platforms, `NSUInteger` is 32-bit, while the objc_direct tests expected it to be represented as `ULong`. So the tests failed on those platforms. Fix the tests by replacing `NSUInteger` with `uint64_t`. --- .../tests/interop/objc/direct/direct.h | 16 ++++++++-------- .../tests/interop/objc/direct/direct.m | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kotlin-native/backend.native/tests/interop/objc/direct/direct.h b/kotlin-native/backend.native/tests/interop/objc/direct/direct.h index 666439b387f..af73d44d981 100644 --- a/kotlin-native/backend.native/tests/interop/objc/direct/direct.h +++ b/kotlin-native/backend.native/tests/interop/objc/direct/direct.h @@ -6,21 +6,21 @@ __attribute__((objc_runtime_name("CC"))) __attribute__((swift_name("CC"))) @interface CallingConventions : NSObject -+ (NSUInteger)regular:(NSUInteger)arg; -- (NSUInteger)regular:(NSUInteger)arg; ++ (uint64_t)regular:(uint64_t)arg; +- (uint64_t)regular:(uint64_t)arg; -+ (NSUInteger)direct:(NSUInteger)arg __attribute__((objc_direct)); -- (NSUInteger)direct:(NSUInteger)arg __attribute__((objc_direct)); ++ (uint64_t)direct:(uint64_t)arg __attribute__((objc_direct)); +- (uint64_t)direct:(uint64_t)arg __attribute__((objc_direct)); @end @interface CallingConventions(Ext) -+ (NSUInteger)regularExt:(NSUInteger)arg; -- (NSUInteger)regularExt:(NSUInteger)arg; ++ (uint64_t)regularExt:(uint64_t)arg; +- (uint64_t)regularExt:(uint64_t)arg; -+ (NSUInteger)directExt:(NSUInteger)arg __attribute__((objc_direct)); -- (NSUInteger)directExt:(NSUInteger)arg __attribute__((objc_direct)); ++ (uint64_t)directExt:(uint64_t)arg __attribute__((objc_direct)); +- (uint64_t)directExt:(uint64_t)arg __attribute__((objc_direct)); @end diff --git a/kotlin-native/backend.native/tests/interop/objc/direct/direct.m b/kotlin-native/backend.native/tests/interop/objc/direct/direct.m index 5d6a7f7efb6..ce893b1c9c6 100644 --- a/kotlin-native/backend.native/tests/interop/objc/direct/direct.m +++ b/kotlin-native/backend.native/tests/interop/objc/direct/direct.m @@ -1,6 +1,6 @@ #import "direct.h" -#define TEST_METHOD_IMPL(NAME) (NSUInteger)NAME:(NSUInteger)arg { return arg; } +#define TEST_METHOD_IMPL(NAME) (uint64_t)NAME:(uint64_t)arg { return arg; } @implementation CallingConventions : NSObject