From 1748715993329c2b96fdb01d9b8baed774417d9e Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 29 Nov 2023 22:37:19 +1300 Subject: [PATCH] [ffigen] Only use `objc_msgSend` variants on x64 (#836) `objc_msgSend_stret` and `objc_msgSend_fpret` are only available on x64, so just use the normal `objc_msgSend` on arm64. We can only check the ABI at runtime, so for the stret and fpret variants we need to emit both the variant and the normal `objc_msgSend` function. Then we can decide which to use when the method is invoked at runtime. This runtime check is complicated by the fact that `objc_msgSend_stret` has a different signature than `objc_msgSend` has for the same method. This is because `objc_msgSend_stret` takes a pointer to the return type as its first arg. If it wasn't for this signature difference we could just change the function name string we pass to `DynamicLibrary.lookup`. Fixes #829 --- pkgs/ffigen/CHANGELOG.md | 1 + .../objective_c/avf_audio_bindings.dart | 1357 +++++++++++++---- .../example/swift/swift_api_bindings.dart | 1249 ++++++++++++--- .../objc_built_in_functions.dart | 120 +- .../src/code_generator/objc_interface.dart | 29 +- 5 files changed, 2226 insertions(+), 530 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 178656d27..ac8e9a4ef 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -5,6 +5,7 @@ bindings to **not** be generated by default, since it may result in invalid bindings if the compiler makes a wrong guess. A flag `--ignore-source-errors` (or yaml config `ignore-source-errors: true`) must be passed to change this behaviour. - __Breaking change__: Stop generating setters for global variables marked `const` in C. +- Fix objc_msgSend being used on arm64 platforms where it's not available. ## 10.0.0 diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index cde69673d..81abd6957 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -1415,25 +1415,45 @@ class AVFAudio { ffi.Pointer, ffi.Pointer, _NSRange)>(); late final _sel_rangeValue1 = _registerName1("rangeValue"); - void _objc_msgSend_54( - ffi.Pointer<_NSRange> stret, + late final _objc_msgSend_useVariants1 = ffi.Abi.current() == ffi.Abi.iosX64 || + ffi.Abi.current() == ffi.Abi.macosX64; + _NSRange _objc_msgSend_54( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_54( - stret, obj, sel, ); } late final __objc_msgSend_54Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_54_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_54_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_54_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_54_variant = + __objc_msgSend_54_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer)>(); late final _sel_valueWithPoint_1 = _registerName1("valueWithPoint:"); ffi.Pointer _objc_msgSend_55( @@ -1521,88 +1541,160 @@ class AVFAudio { ffi.Pointer, ffi.Pointer, NSEdgeInsets)>(); late final _sel_pointValue1 = _registerName1("pointValue"); - void _objc_msgSend_59( - ffi.Pointer stret, + CGPoint _objc_msgSend_59( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_59( - stret, obj, sel, ); } late final __objc_msgSend_59Ptr = _lookup< + ffi.NativeFunction< + CGPoint Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + CGPoint Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_59_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_59_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_59_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_59_variant = + __objc_msgSend_59_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); late final _sel_sizeValue1 = _registerName1("sizeValue"); - void _objc_msgSend_60( - ffi.Pointer stret, + CGSize _objc_msgSend_60( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_60( - stret, obj, sel, ); } late final __objc_msgSend_60Ptr = _lookup< + ffi.NativeFunction< + CGSize Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + CGSize Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_60_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_60_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_60_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_60_variant = + __objc_msgSend_60_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); late final _sel_rectValue1 = _registerName1("rectValue"); - void _objc_msgSend_61( - ffi.Pointer stret, + CGRect _objc_msgSend_61( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_61( - stret, obj, sel, ); } late final __objc_msgSend_61Ptr = _lookup< + ffi.NativeFunction< + CGRect Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + CGRect Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_61_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_61_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_61_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_61_variant = + __objc_msgSend_61_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); late final _sel_edgeInsetsValue1 = _registerName1("edgeInsetsValue"); - void _objc_msgSend_62( - ffi.Pointer stret, + NSEdgeInsets _objc_msgSend_62( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_62( - stret, obj, sel, ); } late final __objc_msgSend_62Ptr = _lookup< + ffi.NativeFunction< + NSEdgeInsets Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + NSEdgeInsets Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_62_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_62_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_62_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_62_variant = + __objc_msgSend_62_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); late final _sel_keyPathsForValuesAffectingValueForKey_1 = _registerName1("keyPathsForValuesAffectingValueForKey:"); @@ -4387,11 +4479,29 @@ class AVFAudio { late final __objc_msgSend_165Ptr = _lookup< ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Double Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_165_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_165_variant( + obj, + sel, + ); + } + + late final __objc_msgSend_165_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_165_variant = + __objc_msgSend_165_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + late final _sel_initWithTimeIntervalSinceReferenceDate_1 = _registerName1("initWithTimeIntervalSinceReferenceDate:"); instancetype _objc_msgSend_166( @@ -4431,11 +4541,32 @@ class AVFAudio { late final __objc_msgSend_167Ptr = _lookup< ffi.NativeFunction< ffi.Double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_167_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anotherDate, + ) { + return __objc_msgSend_167_variant( + obj, + sel, + anotherDate, + ); + } + + late final __objc_msgSend_167_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_167_variant = + __objc_msgSend_167_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + late final _sel_timeIntervalSinceNow1 = _registerName1("timeIntervalSinceNow"); late final _sel_timeIntervalSince19701 = @@ -6296,11 +6427,29 @@ class AVFAudio { late final __objc_msgSend_239Ptr = _lookup< ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Float Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_239 = __objc_msgSend_239Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_239_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_239_variant( + obj, + sel, + ); + } + + late final __objc_msgSend_239_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_239_variant = + __objc_msgSend_239_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + late final _sel_doubleValue1 = _registerName1("doubleValue"); late final _sel_boolValue1 = _registerName1("boolValue"); late final _sel_integerValue1 = _registerName1("integerValue"); @@ -7245,8 +7394,7 @@ class AVFAudio { late final _sel_rangeOfData_options_range_1 = _registerName1("rangeOfData:options:range:"); - void _objc_msgSend_271( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_271( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer dataToFind, @@ -7254,7 +7402,6 @@ class AVFAudio { _NSRange searchRange, ) { return __objc_msgSend_271( - stret, obj, sel, dataToFind, @@ -7264,6 +7411,32 @@ class AVFAudio { } late final __objc_msgSend_271Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_271 = __objc_msgSend_271Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + void _objc_msgSend_271_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataToFind, + int mask, + _NSRange searchRange, + ) { + return __objc_msgSend_271_variant( + stret, + obj, + sel, + dataToFind, + mask, + searchRange, + ); + } + + late final __objc_msgSend_271_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -7272,9 +7445,10 @@ class AVFAudio { ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_271 = __objc_msgSend_271Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + late final __objc_msgSend_271_variant = + __objc_msgSend_271_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); late final _sel_enumerateByteRangesUsingBlock_1 = _registerName1("enumerateByteRangesUsingBlock:"); @@ -8191,11 +8365,32 @@ class AVFAudio { late final __objc_msgSend_307Ptr = _lookup< ffi.NativeFunction< ffi.Float Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_307 = __objc_msgSend_307Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_307_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_307_variant( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_307_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_307_variant = + __objc_msgSend_307_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + late final _sel_decodeDoubleForKey_1 = _registerName1("decodeDoubleForKey:"); double _objc_msgSend_308( ffi.Pointer obj, @@ -8212,11 +8407,32 @@ class AVFAudio { late final __objc_msgSend_308Ptr = _lookup< ffi.NativeFunction< ffi.Double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_308 = __objc_msgSend_308Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_308_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_308_variant( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_308_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_308_variant = + __objc_msgSend_308_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + late final _sel_decodeBytesForKey_returnedLength_1 = _registerName1("decodeBytesForKey:returnedLength:"); ffi.Pointer _objc_msgSend_309( @@ -8749,14 +8965,12 @@ class AVFAudio { ffi.Pointer)>(); late final _sel_decodePointForKey_1 = _registerName1("decodePointForKey:"); - void _objc_msgSend_329( - ffi.Pointer stret, + CGPoint _objc_msgSend_329( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer key, ) { return __objc_msgSend_329( - stret, obj, sel, key, @@ -8764,25 +8978,46 @@ class AVFAudio { } late final __objc_msgSend_329Ptr = _lookup< + ffi.NativeFunction< + CGPoint Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_329 = __objc_msgSend_329Ptr.asFunction< + CGPoint Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_329_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_329_variant( + stret, + obj, + sel, + key, + ); + } + + late final __objc_msgSend_329_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_329 = __objc_msgSend_329Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_329_variant = + __objc_msgSend_329_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_decodeSizeForKey_1 = _registerName1("decodeSizeForKey:"); - void _objc_msgSend_330( - ffi.Pointer stret, + CGSize _objc_msgSend_330( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer key, ) { return __objc_msgSend_330( - stret, obj, sel, key, @@ -8790,25 +9025,46 @@ class AVFAudio { } late final __objc_msgSend_330Ptr = _lookup< + ffi.NativeFunction< + CGSize Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_330 = __objc_msgSend_330Ptr.asFunction< + CGSize Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_330_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_330_variant( + stret, + obj, + sel, + key, + ); + } + + late final __objc_msgSend_330_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_330 = __objc_msgSend_330Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_330_variant = + __objc_msgSend_330_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_decodeRectForKey_1 = _registerName1("decodeRectForKey:"); - void _objc_msgSend_331( - ffi.Pointer stret, + CGRect _objc_msgSend_331( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer key, ) { return __objc_msgSend_331( - stret, obj, sel, key, @@ -8816,15 +9072,38 @@ class AVFAudio { } late final __objc_msgSend_331Ptr = _lookup< + ffi.NativeFunction< + CGRect Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_331 = __objc_msgSend_331Ptr.asFunction< + CGRect Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_331_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_331_variant( + stret, + obj, + sel, + key, + ); + } + + late final __objc_msgSend_331_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_331 = __objc_msgSend_331Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_331_variant = + __objc_msgSend_331_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_substringFromIndex_1 = _registerName1("substringFromIndex:"); ffi.Pointer _objc_msgSend_332( @@ -9039,14 +9318,12 @@ class AVFAudio { _registerName1("localizedStandardContainsString:"); late final _sel_localizedStandardRangeOfString_1 = _registerName1("localizedStandardRangeOfString:"); - void _objc_msgSend_340( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_340( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer str, ) { return __objc_msgSend_340( - stret, obj, sel, str, @@ -9054,28 +9331,49 @@ class AVFAudio { } late final __objc_msgSend_340Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_340 = __objc_msgSend_340Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_340_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + ) { + return __objc_msgSend_340_variant( + stret, + obj, + sel, + str, + ); + } + + late final __objc_msgSend_340_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_340 = __objc_msgSend_340Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_340_variant = + __objc_msgSend_340_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_rangeOfString_1 = _registerName1("rangeOfString:"); late final _sel_rangeOfString_options_1 = _registerName1("rangeOfString:options:"); - void _objc_msgSend_341( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_341( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchString, int mask, ) { return __objc_msgSend_341( - stret, obj, sel, searchString, @@ -9084,6 +9382,30 @@ class AVFAudio { } late final __objc_msgSend_341Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_341 = __objc_msgSend_341Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + void _objc_msgSend_341_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + ) { + return __objc_msgSend_341_variant( + stret, + obj, + sel, + searchString, + mask, + ); + } + + late final __objc_msgSend_341_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9091,14 +9413,14 @@ class AVFAudio { ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend_stret'); - late final __objc_msgSend_341 = __objc_msgSend_341Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + late final __objc_msgSend_341_variant = + __objc_msgSend_341_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); late final _sel_rangeOfString_options_range_1 = _registerName1("rangeOfString:options:range:"); - void _objc_msgSend_342( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_342( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchString, @@ -9106,7 +9428,6 @@ class AVFAudio { _NSRange rangeOfReceiverToSearch, ) { return __objc_msgSend_342( - stret, obj, sel, searchString, @@ -9116,6 +9437,32 @@ class AVFAudio { } late final __objc_msgSend_342Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_342 = __objc_msgSend_342Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + void _objc_msgSend_342_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + _NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_342_variant( + stret, + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_342_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9124,14 +9471,14 @@ class AVFAudio { ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_342 = __objc_msgSend_342Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + late final __objc_msgSend_342_variant = + __objc_msgSend_342_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); late final _sel_rangeOfString_options_range_locale_1 = _registerName1("rangeOfString:options:range:locale:"); - void _objc_msgSend_343( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_343( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchString, @@ -9140,7 +9487,6 @@ class AVFAudio { ffi.Pointer locale, ) { return __objc_msgSend_343( - stret, obj, sel, searchString, @@ -9151,6 +9497,39 @@ class AVFAudio { } late final __objc_msgSend_343Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_343 = __objc_msgSend_343Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange, ffi.Pointer)>(); + + void _objc_msgSend_343_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + _NSRange rangeOfReceiverToSearch, + ffi.Pointer locale, + ) { + return __objc_msgSend_343_variant( + stret, + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + locale, + ); + } + + late final __objc_msgSend_343_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9160,26 +9539,25 @@ class AVFAudio { ffi.Int32, _NSRange, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_343 = __objc_msgSend_343Ptr.asFunction< - void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _NSRange, - ffi.Pointer)>(); + late final __objc_msgSend_343_variant = + __objc_msgSend_343_variantPtr.asFunction< + void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange, + ffi.Pointer)>(); late final _sel_rangeOfCharacterFromSet_1 = _registerName1("rangeOfCharacterFromSet:"); - void _objc_msgSend_344( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_344( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchSet, ) { return __objc_msgSend_344( - stret, obj, sel, searchSet, @@ -9187,27 +9565,48 @@ class AVFAudio { } late final __objc_msgSend_344Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_344 = __objc_msgSend_344Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_344_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + ) { + return __objc_msgSend_344_variant( + stret, + obj, + sel, + searchSet, + ); + } + + late final __objc_msgSend_344_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_344 = __objc_msgSend_344Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_344_variant = + __objc_msgSend_344_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_rangeOfCharacterFromSet_options_1 = _registerName1("rangeOfCharacterFromSet:options:"); - void _objc_msgSend_345( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_345( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchSet, int mask, ) { return __objc_msgSend_345( - stret, obj, sel, searchSet, @@ -9216,6 +9615,30 @@ class AVFAudio { } late final __objc_msgSend_345Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_345 = __objc_msgSend_345Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + void _objc_msgSend_345_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + ) { + return __objc_msgSend_345_variant( + stret, + obj, + sel, + searchSet, + mask, + ); + } + + late final __objc_msgSend_345_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9223,14 +9646,14 @@ class AVFAudio { ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend_stret'); - late final __objc_msgSend_345 = __objc_msgSend_345Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + late final __objc_msgSend_345_variant = + __objc_msgSend_345_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); late final _sel_rangeOfCharacterFromSet_options_range_1 = _registerName1("rangeOfCharacterFromSet:options:range:"); - void _objc_msgSend_346( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_346( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchSet, @@ -9238,7 +9661,6 @@ class AVFAudio { _NSRange rangeOfReceiverToSearch, ) { return __objc_msgSend_346( - stret, obj, sel, searchSet, @@ -9248,6 +9670,32 @@ class AVFAudio { } late final __objc_msgSend_346Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_346 = __objc_msgSend_346Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + void _objc_msgSend_346_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + _NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_346_variant( + stret, + obj, + sel, + searchSet, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_346_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9256,20 +9704,19 @@ class AVFAudio { ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_346 = __objc_msgSend_346Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + late final __objc_msgSend_346_variant = + __objc_msgSend_346_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); late final _sel_rangeOfComposedCharacterSequenceAtIndex_1 = _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); - void _objc_msgSend_347( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_347( ffi.Pointer obj, ffi.Pointer sel, int index, ) { return __objc_msgSend_347( - stret, obj, sel, index, @@ -9277,23 +9724,43 @@ class AVFAudio { } late final __objc_msgSend_347Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_347 = __objc_msgSend_347Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + + void _objc_msgSend_347_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_347_variant( + stret, + obj, + sel, + index, + ); + } + + late final __objc_msgSend_347_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend_stret'); - late final __objc_msgSend_347 = __objc_msgSend_347Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, int)>(); + late final __objc_msgSend_347_variant = + __objc_msgSend_347_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int)>(); late final _sel_rangeOfComposedCharacterSequencesForRange_1 = _registerName1("rangeOfComposedCharacterSequencesForRange:"); - void _objc_msgSend_348( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_348( ffi.Pointer obj, ffi.Pointer sel, _NSRange range, ) { return __objc_msgSend_348( - stret, obj, sel, range, @@ -9301,12 +9768,35 @@ class AVFAudio { } late final __objc_msgSend_348Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_348 = __objc_msgSend_348Ptr.asFunction< + _NSRange Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + void _objc_msgSend_348_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_348_variant( + stret, + obj, + sel, + range, + ); + } + + late final __objc_msgSend_348_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_348 = __objc_msgSend_348Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, _NSRange)>(); + late final __objc_msgSend_348_variant = + __objc_msgSend_348_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, _NSRange)>(); late final _sel_stringByAppendingString_1 = _registerName1("stringByAppendingString:"); @@ -21311,14 +21801,12 @@ class AVFAudio { late final _sel_AMSymbol1 = _registerName1("AMSymbol"); late final _sel_PMSymbol1 = _registerName1("PMSymbol"); late final _sel_minimumRangeOfUnit_1 = _registerName1("minimumRangeOfUnit:"); - void _objc_msgSend_767( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_767( ffi.Pointer obj, ffi.Pointer sel, int unit, ) { return __objc_msgSend_767( - stret, obj, sel, unit, @@ -21326,18 +21814,39 @@ class AVFAudio { } late final __objc_msgSend_767Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_767 = __objc_msgSend_767Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + + void _objc_msgSend_767_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ) { + return __objc_msgSend_767_variant( + stret, + obj, + sel, + unit, + ); + } + + late final __objc_msgSend_767_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend_stret'); - late final __objc_msgSend_767 = __objc_msgSend_767Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, int)>(); + late final __objc_msgSend_767_variant = + __objc_msgSend_767_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int)>(); late final _sel_maximumRangeOfUnit_1 = _registerName1("maximumRangeOfUnit:"); late final _sel_rangeOfUnit_inUnit_forDate_1 = _registerName1("rangeOfUnit:inUnit:forDate:"); - void _objc_msgSend_768( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_768( ffi.Pointer obj, ffi.Pointer sel, int smaller, @@ -21345,7 +21854,6 @@ class AVFAudio { ffi.Pointer date, ) { return __objc_msgSend_768( - stret, obj, sel, smaller, @@ -21355,6 +21863,32 @@ class AVFAudio { } late final __objc_msgSend_768Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_768 = __objc_msgSend_768Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, int, int, + ffi.Pointer)>(); + + void _objc_msgSend_768_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + int smaller, + int larger, + ffi.Pointer date, + ) { + return __objc_msgSend_768_variant( + stret, + obj, + sel, + smaller, + larger, + date, + ); + } + + late final __objc_msgSend_768_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -21363,9 +21897,10 @@ class AVFAudio { ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_768 = __objc_msgSend_768Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); + late final __objc_msgSend_768_variant = + __objc_msgSend_768_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); late final _sel_ordinalityOfUnit_inUnit_forDate_1 = _registerName1("ordinalityOfUnit:inUnit:forDate:"); @@ -26192,27 +26727,46 @@ class AVFAudio { _registerName1("operatingSystemVersionString"); late final _sel_operatingSystemVersion1 = _registerName1("operatingSystemVersion"); - void _objc_msgSend_940( - ffi.Pointer stret, + NSOperatingSystemVersion _objc_msgSend_940( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_940( - stret, obj, sel, ); } late final __objc_msgSend_940Ptr = _lookup< + ffi.NativeFunction< + NSOperatingSystemVersion Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_940 = __objc_msgSend_940Ptr.asFunction< + NSOperatingSystemVersion Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_940_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_940_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_940_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_940 = __objc_msgSend_940Ptr.asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_940_variant = + __objc_msgSend_940_variantPtr.asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_processorCount1 = _registerName1("processorCount"); late final _sel_activeProcessorCount1 = @@ -26623,8 +27177,7 @@ class AVFAudio { late final _sel_rangeOfFirstMatchInString_options_range_1 = _registerName1("rangeOfFirstMatchInString:options:range:"); - void _objc_msgSend_955( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_955( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer string, @@ -26632,7 +27185,6 @@ class AVFAudio { _NSRange range, ) { return __objc_msgSend_955( - stret, obj, sel, string, @@ -26642,6 +27194,32 @@ class AVFAudio { } late final __objc_msgSend_955Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_955 = __objc_msgSend_955Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + void _objc_msgSend_955_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + _NSRange range, + ) { + return __objc_msgSend_955_variant( + stret, + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_955_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -26650,9 +27228,10 @@ class AVFAudio { ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_955 = __objc_msgSend_955Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + late final __objc_msgSend_955_variant = + __objc_msgSend_955_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); late final _sel_stringByReplacingMatchesInString_options_range_withTemplate_1 = _registerName1( @@ -33166,10 +33745,31 @@ class AVFAudio { late final __objc_msgSend_1193Ptr = _lookup< ffi.NativeFunction< ffi.Float Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedLong)>>('objc_msgSend_fpret'); + ffi.UnsignedLong)>>('objc_msgSend'); late final __objc_msgSend_1193 = __objc_msgSend_1193Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer, int)>(); + double _objc_msgSend_1193_variant( + ffi.Pointer obj, + ffi.Pointer sel, + int channelNumber, + ) { + return __objc_msgSend_1193_variant( + obj, + sel, + channelNumber, + ); + } + + late final __objc_msgSend_1193_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend_fpret'); + late final __objc_msgSend_1193_variant = + __objc_msgSend_1193_variantPtr.asFunction< + double Function( + ffi.Pointer, ffi.Pointer, int)>(); + late final _sel_averagePowerForChannel_1 = _registerName1("averagePowerForChannel:"); late final _sel_channelAssignments1 = _registerName1("channelAssignments"); @@ -35168,25 +35768,46 @@ class NSString extends NSObject { void localizedStandardRangeOfString_( ffi.Pointer<_NSRange> stret, NSString str) { - _lib._objc_msgSend_340( - stret, _id, _lib._sel_localizedStandardRangeOfString_1, str._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_340_variant( + stret, _id, _lib._sel_localizedStandardRangeOfString_1, str._id) + : stret.ref = _lib._objc_msgSend_340( + _id, _lib._sel_localizedStandardRangeOfString_1, str._id); } void rangeOfString_(ffi.Pointer<_NSRange> stret, NSString searchString) { - _lib._objc_msgSend_340( - stret, _id, _lib._sel_rangeOfString_1, searchString._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_340_variant( + stret, _id, _lib._sel_rangeOfString_1, searchString._id) + : stret.ref = _lib._objc_msgSend_340( + _id, _lib._sel_rangeOfString_1, searchString._id); } void rangeOfString_options_( ffi.Pointer<_NSRange> stret, NSString searchString, int mask) { - _lib._objc_msgSend_341( - stret, _id, _lib._sel_rangeOfString_options_1, searchString._id, mask); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_341_variant(stret, _id, + _lib._sel_rangeOfString_options_1, searchString._id, mask) + : stret.ref = _lib._objc_msgSend_341( + _id, _lib._sel_rangeOfString_options_1, searchString._id, mask); } void rangeOfString_options_range_(ffi.Pointer<_NSRange> stret, NSString searchString, int mask, _NSRange rangeOfReceiverToSearch) { - _lib._objc_msgSend_342(stret, _id, _lib._sel_rangeOfString_options_range_1, - searchString._id, mask, rangeOfReceiverToSearch); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_342_variant( + stret, + _id, + _lib._sel_rangeOfString_options_range_1, + searchString._id, + mask, + rangeOfReceiverToSearch) + : stret.ref = _lib._objc_msgSend_342( + _id, + _lib._sel_rangeOfString_options_range_1, + searchString._id, + mask, + rangeOfReceiverToSearch); } void rangeOfString_options_range_locale_( @@ -35195,49 +35816,76 @@ class NSString extends NSObject { int mask, _NSRange rangeOfReceiverToSearch, NSLocale? locale) { - _lib._objc_msgSend_343( - stret, - _id, - _lib._sel_rangeOfString_options_range_locale_1, - searchString._id, - mask, - rangeOfReceiverToSearch, - locale?._id ?? ffi.nullptr); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_343_variant( + stret, + _id, + _lib._sel_rangeOfString_options_range_locale_1, + searchString._id, + mask, + rangeOfReceiverToSearch, + locale?._id ?? ffi.nullptr) + : stret.ref = _lib._objc_msgSend_343( + _id, + _lib._sel_rangeOfString_options_range_locale_1, + searchString._id, + mask, + rangeOfReceiverToSearch, + locale?._id ?? ffi.nullptr); } void rangeOfCharacterFromSet_( ffi.Pointer<_NSRange> stret, NSCharacterSet searchSet) { - _lib._objc_msgSend_344( - stret, _id, _lib._sel_rangeOfCharacterFromSet_1, searchSet._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_344_variant( + stret, _id, _lib._sel_rangeOfCharacterFromSet_1, searchSet._id) + : stret.ref = _lib._objc_msgSend_344( + _id, _lib._sel_rangeOfCharacterFromSet_1, searchSet._id); } void rangeOfCharacterFromSet_options_( ffi.Pointer<_NSRange> stret, NSCharacterSet searchSet, int mask) { - _lib._objc_msgSend_345(stret, _id, - _lib._sel_rangeOfCharacterFromSet_options_1, searchSet._id, mask); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_345_variant(stret, _id, + _lib._sel_rangeOfCharacterFromSet_options_1, searchSet._id, mask) + : stret.ref = _lib._objc_msgSend_345(_id, + _lib._sel_rangeOfCharacterFromSet_options_1, searchSet._id, mask); } void rangeOfCharacterFromSet_options_range_(ffi.Pointer<_NSRange> stret, NSCharacterSet searchSet, int mask, _NSRange rangeOfReceiverToSearch) { - _lib._objc_msgSend_346( - stret, - _id, - _lib._sel_rangeOfCharacterFromSet_options_range_1, - searchSet._id, - mask, - rangeOfReceiverToSearch); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_346_variant( + stret, + _id, + _lib._sel_rangeOfCharacterFromSet_options_range_1, + searchSet._id, + mask, + rangeOfReceiverToSearch) + : stret.ref = _lib._objc_msgSend_346( + _id, + _lib._sel_rangeOfCharacterFromSet_options_range_1, + searchSet._id, + mask, + rangeOfReceiverToSearch); } void rangeOfComposedCharacterSequenceAtIndex_( ffi.Pointer<_NSRange> stret, int index) { - _lib._objc_msgSend_347( - stret, _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_347_variant(stret, _id, + _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index) + : stret.ref = _lib._objc_msgSend_347( + _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); } void rangeOfComposedCharacterSequencesForRange_( ffi.Pointer<_NSRange> stret, _NSRange range) { - _lib._objc_msgSend_348(stret, _id, - _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_348_variant(stret, _id, + _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range) + : stret.ref = _lib._objc_msgSend_348( + _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); } NSString stringByAppendingString_(NSString aString) { @@ -35253,11 +35901,15 @@ class NSString extends NSObject { } double get doubleValue { - return _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_doubleValue1) + : _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); } double get floatValue { - return _lib._objc_msgSend_239(_id, _lib._sel_floatValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_floatValue1) + : _lib._objc_msgSend_239(_id, _lib._sel_floatValue1); } int get intValue { @@ -35342,7 +35994,11 @@ class NSString extends NSObject { } void lineRangeForRange_(ffi.Pointer<_NSRange> stret, _NSRange range) { - _lib._objc_msgSend_348(stret, _id, _lib._sel_lineRangeForRange_1, range); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_348_variant( + stret, _id, _lib._sel_lineRangeForRange_1, range) + : stret.ref = + _lib._objc_msgSend_348(_id, _lib._sel_lineRangeForRange_1, range); } void getParagraphStart_end_contentsEnd_forRange_( @@ -35360,8 +36016,11 @@ class NSString extends NSObject { } void paragraphRangeForRange_(ffi.Pointer<_NSRange> stret, _NSRange range) { - _lib._objc_msgSend_348( - stret, _id, _lib._sel_paragraphRangeForRange_1, range); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_348_variant( + stret, _id, _lib._sel_paragraphRangeForRange_1, range) + : stret.ref = _lib._objc_msgSend_348( + _id, _lib._sel_paragraphRangeForRange_1, range); } void enumerateSubstringsInRange_options_usingBlock_(_NSRange range, int opts, @@ -36651,11 +37310,17 @@ class NSCoder extends NSObject { } double decodeFloatForKey_(NSString key) { - return _lib._objc_msgSend_307(_id, _lib._sel_decodeFloatForKey_1, key._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_307_variant( + _id, _lib._sel_decodeFloatForKey_1, key._id) + : _lib._objc_msgSend_307(_id, _lib._sel_decodeFloatForKey_1, key._id); } double decodeDoubleForKey_(NSString key) { - return _lib._objc_msgSend_308(_id, _lib._sel_decodeDoubleForKey_1, key._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_308_variant( + _id, _lib._sel_decodeDoubleForKey_1, key._id) + : _lib._objc_msgSend_308(_id, _lib._sel_decodeDoubleForKey_1, key._id); } ffi.Pointer decodeBytesForKey_returnedLength_( @@ -36817,7 +37482,9 @@ class NSCoder extends NSObject { } void decodePoint(ffi.Pointer stret) { - _lib._objc_msgSend_59(stret, _id, _lib._sel_decodePoint1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_59_variant(stret, _id, _lib._sel_decodePoint1) + : stret.ref = _lib._objc_msgSend_59(_id, _lib._sel_decodePoint1); } void encodeSize_(CGSize size) { @@ -36825,7 +37492,9 @@ class NSCoder extends NSObject { } void decodeSize(ffi.Pointer stret) { - _lib._objc_msgSend_60(stret, _id, _lib._sel_decodeSize1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_60_variant(stret, _id, _lib._sel_decodeSize1) + : stret.ref = _lib._objc_msgSend_60(_id, _lib._sel_decodeSize1); } void encodeRect_(CGRect rect) { @@ -36833,7 +37502,9 @@ class NSCoder extends NSObject { } void decodeRect(ffi.Pointer stret) { - _lib._objc_msgSend_61(stret, _id, _lib._sel_decodeRect1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_61_variant(stret, _id, _lib._sel_decodeRect1) + : stret.ref = _lib._objc_msgSend_61(_id, _lib._sel_decodeRect1); } void encodePoint_forKey_(CGPoint point, NSString key) { @@ -36849,15 +37520,27 @@ class NSCoder extends NSObject { } void decodePointForKey_(ffi.Pointer stret, NSString key) { - _lib._objc_msgSend_329(stret, _id, _lib._sel_decodePointForKey_1, key._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_329_variant( + stret, _id, _lib._sel_decodePointForKey_1, key._id) + : stret.ref = + _lib._objc_msgSend_329(_id, _lib._sel_decodePointForKey_1, key._id); } void decodeSizeForKey_(ffi.Pointer stret, NSString key) { - _lib._objc_msgSend_330(stret, _id, _lib._sel_decodeSizeForKey_1, key._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_330_variant( + stret, _id, _lib._sel_decodeSizeForKey_1, key._id) + : stret.ref = + _lib._objc_msgSend_330(_id, _lib._sel_decodeSizeForKey_1, key._id); } void decodeRectForKey_(ffi.Pointer stret, NSString key) { - _lib._objc_msgSend_331(stret, _id, _lib._sel_decodeRectForKey_1, key._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_331_variant( + stret, _id, _lib._sel_decodeRectForKey_1, key._id) + : stret.ref = + _lib._objc_msgSend_331(_id, _lib._sel_decodeRectForKey_1, key._id); } @override @@ -37023,8 +37706,20 @@ class NSData extends NSObject { void rangeOfData_options_range_(ffi.Pointer<_NSRange> stret, NSData dataToFind, int mask, _NSRange searchRange) { - _lib._objc_msgSend_271(stret, _id, _lib._sel_rangeOfData_options_range_1, - dataToFind._id, mask, searchRange); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_271_variant( + stret, + _id, + _lib._sel_rangeOfData_options_range_1, + dataToFind._id, + mask, + searchRange) + : stret.ref = _lib._objc_msgSend_271( + _id, + _lib._sel_rangeOfData_options_range_1, + dataToFind._id, + mask, + searchRange); } void enumerateByteRangesUsingBlock_( @@ -38315,11 +39010,15 @@ class NSNumber extends NSValue { } double get floatValue { - return _lib._objc_msgSend_239(_id, _lib._sel_floatValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_floatValue1) + : _lib._objc_msgSend_239(_id, _lib._sel_floatValue1); } double get doubleValue { - return _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_doubleValue1) + : _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); } bool get boolValue { @@ -38694,7 +39393,9 @@ class NSValue extends NSObject { } void getRangeValue(ffi.Pointer<_NSRange> stret) { - _lib._objc_msgSend_54(stret, _id, _lib._sel_rangeValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_54_variant(stret, _id, _lib._sel_rangeValue1) + : stret.ref = _lib._objc_msgSend_54(_id, _lib._sel_rangeValue1); } static NSValue valueWithPoint_(AVFAudio _lib, CGPoint point) { @@ -38722,19 +39423,27 @@ class NSValue extends NSObject { } void getPointValue(ffi.Pointer stret) { - _lib._objc_msgSend_59(stret, _id, _lib._sel_pointValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_59_variant(stret, _id, _lib._sel_pointValue1) + : stret.ref = _lib._objc_msgSend_59(_id, _lib._sel_pointValue1); } void getSizeValue(ffi.Pointer stret) { - _lib._objc_msgSend_60(stret, _id, _lib._sel_sizeValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_60_variant(stret, _id, _lib._sel_sizeValue1) + : stret.ref = _lib._objc_msgSend_60(_id, _lib._sel_sizeValue1); } void getRectValue(ffi.Pointer stret) { - _lib._objc_msgSend_61(stret, _id, _lib._sel_rectValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_61_variant(stret, _id, _lib._sel_rectValue1) + : stret.ref = _lib._objc_msgSend_61(_id, _lib._sel_rectValue1); } void getEdgeInsetsValue(ffi.Pointer stret) { - _lib._objc_msgSend_62(stret, _id, _lib._sel_edgeInsetsValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_62_variant(stret, _id, _lib._sel_edgeInsetsValue1) + : stret.ref = _lib._objc_msgSend_62(_id, _lib._sel_edgeInsetsValue1); } @override @@ -42107,8 +42816,11 @@ class NSDate extends NSObject { } double get timeIntervalSinceReferenceDate { - return _lib._objc_msgSend_165( - _id, _lib._sel_timeIntervalSinceReferenceDate1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_timeIntervalSinceReferenceDate1) + : _lib._objc_msgSend_165( + _id, _lib._sel_timeIntervalSinceReferenceDate1); } @override @@ -42132,16 +42844,23 @@ class NSDate extends NSObject { } double timeIntervalSinceDate_(NSDate anotherDate) { - return _lib._objc_msgSend_167( - _id, _lib._sel_timeIntervalSinceDate_1, anotherDate._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_167_variant( + _id, _lib._sel_timeIntervalSinceDate_1, anotherDate._id) + : _lib._objc_msgSend_167( + _id, _lib._sel_timeIntervalSinceDate_1, anotherDate._id); } double get timeIntervalSinceNow { - return _lib._objc_msgSend_165(_id, _lib._sel_timeIntervalSinceNow1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeIntervalSinceNow1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeIntervalSinceNow1); } double get timeIntervalSince1970 { - return _lib._objc_msgSend_165(_id, _lib._sel_timeIntervalSince19701); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeIntervalSince19701) + : _lib._objc_msgSend_165(_id, _lib._sel_timeIntervalSince19701); } NSObject addTimeInterval_(double seconds) { @@ -42894,8 +43613,11 @@ class NSTimeZone extends NSObject { } double daylightSavingTimeOffsetForDate_(NSDate aDate) { - return _lib._objc_msgSend_167( - _id, _lib._sel_daylightSavingTimeOffsetForDate_1, aDate._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_167_variant( + _id, _lib._sel_daylightSavingTimeOffsetForDate_1, aDate._id) + : _lib._objc_msgSend_167( + _id, _lib._sel_daylightSavingTimeOffsetForDate_1, aDate._id); } NSDate? nextDaylightSavingTimeTransitionAfterDate_(NSDate aDate) { @@ -42973,7 +43695,10 @@ class NSTimeZone extends NSObject { } double get daylightSavingTimeOffset { - return _lib._objc_msgSend_165(_id, _lib._sel_daylightSavingTimeOffset1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_daylightSavingTimeOffset1) + : _lib._objc_msgSend_165(_id, _lib._sel_daylightSavingTimeOffset1); } NSDate? get nextDaylightSavingTimeTransition { @@ -48778,7 +49503,9 @@ class NSThread extends NSObject { } double get threadPriority { - return _lib._objc_msgSend_165(_id, _lib._sel_threadPriority1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_threadPriority1) + : _lib._objc_msgSend_165(_id, _lib._sel_threadPriority1); } set threadPriority(double value) { @@ -50254,11 +50981,15 @@ class NSTimer extends NSObject { } double get timeInterval { - return _lib._objc_msgSend_165(_id, _lib._sel_timeInterval1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeInterval1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeInterval1); } double get tolerance { - return _lib._objc_msgSend_165(_id, _lib._sel_tolerance1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_tolerance1) + : _lib._objc_msgSend_165(_id, _lib._sel_tolerance1); } set tolerance(double value) { @@ -50591,7 +51322,9 @@ class NSConnection extends NSObject { } double get requestTimeout { - return _lib._objc_msgSend_165(_id, _lib._sel_requestTimeout1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_requestTimeout1) + : _lib._objc_msgSend_165(_id, _lib._sel_requestTimeout1); } set requestTimeout(double value) { @@ -50599,7 +51332,9 @@ class NSConnection extends NSObject { } double get replyTimeout { - return _lib._objc_msgSend_165(_id, _lib._sel_replyTimeout1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_replyTimeout1) + : _lib._objc_msgSend_165(_id, _lib._sel_replyTimeout1); } set replyTimeout(double value) { @@ -51851,7 +52586,9 @@ class NSAppleEventDescriptor extends NSObject { } double get doubleValue { - return _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_doubleValue1) + : _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); } int get typeCodeValue { @@ -53480,7 +54217,9 @@ class NSProgress extends NSObject { } double get fractionCompleted { - return _lib._objc_msgSend_165(_id, _lib._sel_fractionCompleted1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_fractionCompleted1) + : _lib._objc_msgSend_165(_id, _lib._sel_fractionCompleted1); } bool get finished { @@ -56140,8 +56879,11 @@ class NSBundle extends NSObject { } double preservationPriorityForTag_(NSString tag) { - return _lib._objc_msgSend_308( - _id, _lib._sel_preservationPriorityForTag_1, tag._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_308_variant( + _id, _lib._sel_preservationPriorityForTag_1, tag._id) + : _lib._objc_msgSend_308( + _id, _lib._sel_preservationPriorityForTag_1, tag._id); } @override @@ -58394,17 +59136,28 @@ class NSCalendar extends NSObject { } void minimumRangeOfUnit_(ffi.Pointer<_NSRange> stret, int unit) { - _lib._objc_msgSend_767(stret, _id, _lib._sel_minimumRangeOfUnit_1, unit); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_767_variant( + stret, _id, _lib._sel_minimumRangeOfUnit_1, unit) + : stret.ref = + _lib._objc_msgSend_767(_id, _lib._sel_minimumRangeOfUnit_1, unit); } void maximumRangeOfUnit_(ffi.Pointer<_NSRange> stret, int unit) { - _lib._objc_msgSend_767(stret, _id, _lib._sel_maximumRangeOfUnit_1, unit); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_767_variant( + stret, _id, _lib._sel_maximumRangeOfUnit_1, unit) + : stret.ref = + _lib._objc_msgSend_767(_id, _lib._sel_maximumRangeOfUnit_1, unit); } void rangeOfUnit_inUnit_forDate_( ffi.Pointer<_NSRange> stret, int smaller, int larger, NSDate date) { - _lib._objc_msgSend_768(stret, _id, _lib._sel_rangeOfUnit_inUnit_forDate_1, - smaller, larger, date._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_768_variant(stret, _id, + _lib._sel_rangeOfUnit_inUnit_forDate_1, smaller, larger, date._id) + : stret.ref = _lib._objc_msgSend_768(_id, + _lib._sel_rangeOfUnit_inUnit_forDate_1, smaller, larger, date._id); } int ordinalityOfUnit_inUnit_forDate_(int smaller, int larger, NSDate date) { @@ -61817,7 +62570,9 @@ class NSURLSessionTask extends NSObject { } double get priority { - return _lib._objc_msgSend_239(_id, _lib._sel_priority1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_priority1) + : _lib._objc_msgSend_239(_id, _lib._sel_priority1); } set priority(double value) { @@ -61995,7 +62750,9 @@ class NSURLRequest extends NSObject { } double get timeoutInterval { - return _lib._objc_msgSend_165(_id, _lib._sel_timeoutInterval1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeoutInterval1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeoutInterval1); } NSURL? get mainDocumentURL { @@ -64366,7 +65123,9 @@ class NSOperation extends NSObject { } double get threadPriority { - return _lib._objc_msgSend_165(_id, _lib._sel_threadPriority1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_threadPriority1) + : _lib._objc_msgSend_165(_id, _lib._sel_threadPriority1); } set threadPriority(double value) { @@ -65063,7 +65822,11 @@ class NSProcessInfo extends NSObject { } void getOperatingSystemVersion(ffi.Pointer stret) { - _lib._objc_msgSend_940(stret, _id, _lib._sel_operatingSystemVersion1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_940_variant( + stret, _id, _lib._sel_operatingSystemVersion1) + : stret.ref = + _lib._objc_msgSend_940(_id, _lib._sel_operatingSystemVersion1); } int get processorCount { @@ -65084,7 +65847,9 @@ class NSProcessInfo extends NSObject { } double get systemUptime { - return _lib._objc_msgSend_165(_id, _lib._sel_systemUptime1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_systemUptime1) + : _lib._objc_msgSend_165(_id, _lib._sel_systemUptime1); } void disableSuddenTermination() { @@ -65412,7 +66177,9 @@ class NSTextCheckingResult extends NSObject { } void getRange(ffi.Pointer<_NSRange> stret) { - _lib._objc_msgSend_54(stret, _id, _lib._sel_range1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_54_variant(stret, _id, _lib._sel_range1) + : stret.ref = _lib._objc_msgSend_54(_id, _lib._sel_range1); } NSOrthography? get orthography { @@ -65444,7 +66211,9 @@ class NSTextCheckingResult extends NSObject { } double get duration { - return _lib._objc_msgSend_165(_id, _lib._sel_duration1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_duration1) + : _lib._objc_msgSend_165(_id, _lib._sel_duration1); } NSDictionary? get components { @@ -65494,11 +66263,19 @@ class NSTextCheckingResult extends NSObject { } void rangeAtIndex_(ffi.Pointer<_NSRange> stret, int idx) { - _lib._objc_msgSend_347(stret, _id, _lib._sel_rangeAtIndex_1, idx); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_347_variant( + stret, _id, _lib._sel_rangeAtIndex_1, idx) + : stret.ref = + _lib._objc_msgSend_347(_id, _lib._sel_rangeAtIndex_1, idx); } void rangeWithName_(ffi.Pointer<_NSRange> stret, NSString name) { - _lib._objc_msgSend_340(stret, _id, _lib._sel_rangeWithName_1, name._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_340_variant( + stret, _id, _lib._sel_rangeWithName_1, name._id) + : stret.ref = + _lib._objc_msgSend_340(_id, _lib._sel_rangeWithName_1, name._id); } NSTextCheckingResult resultByAdjustingRangesWithOffset_(int offset) { @@ -65887,13 +66664,20 @@ class NSRegularExpression extends NSObject { void rangeOfFirstMatchInString_options_range_(ffi.Pointer<_NSRange> stret, NSString string, int options, _NSRange range) { - _lib._objc_msgSend_955( - stret, - _id, - _lib._sel_rangeOfFirstMatchInString_options_range_1, - string._id, - options, - range); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_955_variant( + stret, + _id, + _lib._sel_rangeOfFirstMatchInString_options_range_1, + string._id, + options, + range) + : stret.ref = _lib._objc_msgSend_955( + _id, + _lib._sel_rangeOfFirstMatchInString_options_range_1, + string._id, + options, + range); } NSString stringByReplacingMatchesInString_options_range_withTemplate_( @@ -68306,7 +69090,9 @@ class NSMutableURLRequest extends NSURLRequest { @override double get timeoutInterval { - return _lib._objc_msgSend_165(_id, _lib._sel_timeoutInterval1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeoutInterval1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeoutInterval1); } set timeoutInterval(double value) { @@ -69631,7 +70417,10 @@ class NSURLSessionConfiguration extends NSObject { } double get timeoutIntervalForRequest { - return _lib._objc_msgSend_165(_id, _lib._sel_timeoutIntervalForRequest1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_timeoutIntervalForRequest1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeoutIntervalForRequest1); } set timeoutIntervalForRequest(double value) { @@ -69640,7 +70429,10 @@ class NSURLSessionConfiguration extends NSObject { } double get timeoutIntervalForResource { - return _lib._objc_msgSend_165(_id, _lib._sel_timeoutIntervalForResource1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_timeoutIntervalForResource1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeoutIntervalForResource1); } set timeoutIntervalForResource(double value) { @@ -74666,7 +75458,9 @@ class AVAudioSession extends NSObject { } double get preferredSampleRate { - return _lib._objc_msgSend_165(_id, _lib._sel_preferredSampleRate1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_preferredSampleRate1) + : _lib._objc_msgSend_165(_id, _lib._sel_preferredSampleRate1); } bool setPreferredIOBufferDuration_error_( @@ -74676,7 +75470,10 @@ class AVAudioSession extends NSObject { } double get preferredIOBufferDuration { - return _lib._objc_msgSend_165(_id, _lib._sel_preferredIOBufferDuration1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_preferredIOBufferDuration1) + : _lib._objc_msgSend_165(_id, _lib._sel_preferredIOBufferDuration1); } bool setPreferredInputNumberOfChannels_error_( @@ -74730,7 +75527,9 @@ class AVAudioSession extends NSObject { } double get inputGain { - return _lib._objc_msgSend_239(_id, _lib._sel_inputGain1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_inputGain1) + : _lib._objc_msgSend_239(_id, _lib._sel_inputGain1); } bool get inputGainSettable { @@ -74786,7 +75585,9 @@ class AVAudioSession extends NSObject { } double get sampleRate { - return _lib._objc_msgSend_165(_id, _lib._sel_sampleRate1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_sampleRate1) + : _lib._objc_msgSend_165(_id, _lib._sel_sampleRate1); } int get inputNumberOfChannels { @@ -74798,15 +75599,21 @@ class AVAudioSession extends NSObject { } double get inputLatency { - return _lib._objc_msgSend_165(_id, _lib._sel_inputLatency1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_inputLatency1) + : _lib._objc_msgSend_165(_id, _lib._sel_inputLatency1); } double get outputLatency { - return _lib._objc_msgSend_165(_id, _lib._sel_outputLatency1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_outputLatency1) + : _lib._objc_msgSend_165(_id, _lib._sel_outputLatency1); } double get IOBufferDuration { - return _lib._objc_msgSend_165(_id, _lib._sel_IOBufferDuration1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_IOBufferDuration1) + : _lib._objc_msgSend_165(_id, _lib._sel_IOBufferDuration1); } bool get otherAudioPlaying { @@ -74819,7 +75626,9 @@ class AVAudioSession extends NSObject { } double get outputVolume { - return _lib._objc_msgSend_239(_id, _lib._sel_outputVolume1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_outputVolume1) + : _lib._objc_msgSend_239(_id, _lib._sel_outputVolume1); } int get promptStyle { @@ -74898,7 +75707,10 @@ class AVAudioSession extends NSObject { } double get currentHardwareSampleRate { - return _lib._objc_msgSend_165(_id, _lib._sel_currentHardwareSampleRate1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_currentHardwareSampleRate1) + : _lib._objc_msgSend_165(_id, _lib._sel_currentHardwareSampleRate1); } int get currentHardwareInputNumberOfChannels { @@ -74918,7 +75730,10 @@ class AVAudioSession extends NSObject { } double get preferredHardwareSampleRate { - return _lib._objc_msgSend_165(_id, _lib._sel_preferredHardwareSampleRate1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_preferredHardwareSampleRate1) + : _lib._objc_msgSend_165(_id, _lib._sel_preferredHardwareSampleRate1); } static AVAudioSession new1(AVFAudio _lib) { @@ -75781,7 +76596,9 @@ class AVAudioPlayer extends NSObject { } double get duration { - return _lib._objc_msgSend_165(_id, _lib._sel_duration1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_duration1) + : _lib._objc_msgSend_165(_id, _lib._sel_duration1); } NSString? get currentDevice { @@ -75823,7 +76640,9 @@ class AVAudioPlayer extends NSObject { } double get pan { - return _lib._objc_msgSend_239(_id, _lib._sel_pan1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_pan1) + : _lib._objc_msgSend_239(_id, _lib._sel_pan1); } set pan(double value) { @@ -75831,7 +76650,9 @@ class AVAudioPlayer extends NSObject { } double get volume { - return _lib._objc_msgSend_239(_id, _lib._sel_volume1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_volume1) + : _lib._objc_msgSend_239(_id, _lib._sel_volume1); } set volume(double value) { @@ -75852,7 +76673,9 @@ class AVAudioPlayer extends NSObject { } double get rate { - return _lib._objc_msgSend_239(_id, _lib._sel_rate1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_rate1) + : _lib._objc_msgSend_239(_id, _lib._sel_rate1); } set rate(double value) { @@ -75860,7 +76683,9 @@ class AVAudioPlayer extends NSObject { } double get currentTime { - return _lib._objc_msgSend_165(_id, _lib._sel_currentTime1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_currentTime1) + : _lib._objc_msgSend_165(_id, _lib._sel_currentTime1); } set currentTime(double value) { @@ -75868,7 +76693,9 @@ class AVAudioPlayer extends NSObject { } double get deviceCurrentTime { - return _lib._objc_msgSend_165(_id, _lib._sel_deviceCurrentTime1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_deviceCurrentTime1) + : _lib._objc_msgSend_165(_id, _lib._sel_deviceCurrentTime1); } int get numberOfLoops { @@ -75902,13 +76729,19 @@ class AVAudioPlayer extends NSObject { } double peakPowerForChannel_(int channelNumber) { - return _lib._objc_msgSend_1193( - _id, _lib._sel_peakPowerForChannel_1, channelNumber); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_1193_variant( + _id, _lib._sel_peakPowerForChannel_1, channelNumber) + : _lib._objc_msgSend_1193( + _id, _lib._sel_peakPowerForChannel_1, channelNumber); } double averagePowerForChannel_(int channelNumber) { - return _lib._objc_msgSend_1193( - _id, _lib._sel_averagePowerForChannel_1, channelNumber); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_1193_variant( + _id, _lib._sel_averagePowerForChannel_1, channelNumber) + : _lib._objc_msgSend_1193( + _id, _lib._sel_averagePowerForChannel_1, channelNumber); } NSArray? get channelAssignments { @@ -76140,7 +76973,9 @@ class AVAudioFormat extends NSObject { } double get sampleRate { - return _lib._objc_msgSend_165(_id, _lib._sel_sampleRate1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_sampleRate1) + : _lib._objc_msgSend_165(_id, _lib._sel_sampleRate1); } bool get interleaved { diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart index ec0c69cdb..10ba3b505 100644 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -1420,25 +1420,45 @@ class SwiftLibrary { ffi.Pointer, ffi.Pointer, _NSRange)>(); late final _sel_rangeValue1 = _registerName1("rangeValue"); - void _objc_msgSend_54( - ffi.Pointer<_NSRange> stret, + late final _objc_msgSend_useVariants1 = ffi.Abi.current() == ffi.Abi.iosX64 || + ffi.Abi.current() == ffi.Abi.macosX64; + _NSRange _objc_msgSend_54( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_54( - stret, obj, sel, ); } late final __objc_msgSend_54Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_54_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_54_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_54_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_54_variant = + __objc_msgSend_54_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer)>(); late final _sel_valueWithPoint_1 = _registerName1("valueWithPoint:"); ffi.Pointer _objc_msgSend_55( @@ -1526,88 +1546,160 @@ class SwiftLibrary { ffi.Pointer, ffi.Pointer, NSEdgeInsets)>(); late final _sel_pointValue1 = _registerName1("pointValue"); - void _objc_msgSend_59( - ffi.Pointer stret, + CGPoint _objc_msgSend_59( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_59( - stret, obj, sel, ); } late final __objc_msgSend_59Ptr = _lookup< + ffi.NativeFunction< + CGPoint Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< + CGPoint Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_59_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_59_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_59_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_59_variant = + __objc_msgSend_59_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); late final _sel_sizeValue1 = _registerName1("sizeValue"); - void _objc_msgSend_60( - ffi.Pointer stret, + CGSize _objc_msgSend_60( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_60( - stret, obj, sel, ); } late final __objc_msgSend_60Ptr = _lookup< + ffi.NativeFunction< + CGSize Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< + CGSize Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_60_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_60_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_60_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_60_variant = + __objc_msgSend_60_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); late final _sel_rectValue1 = _registerName1("rectValue"); - void _objc_msgSend_61( - ffi.Pointer stret, + CGRect _objc_msgSend_61( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_61( - stret, obj, sel, ); } late final __objc_msgSend_61Ptr = _lookup< + ffi.NativeFunction< + CGRect Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< + CGRect Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_61_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_61_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_61_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_61 = __objc_msgSend_61Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_61_variant = + __objc_msgSend_61_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); late final _sel_edgeInsetsValue1 = _registerName1("edgeInsetsValue"); - void _objc_msgSend_62( - ffi.Pointer stret, + NSEdgeInsets _objc_msgSend_62( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_62( - stret, obj, sel, ); } late final __objc_msgSend_62Ptr = _lookup< + ffi.NativeFunction< + NSEdgeInsets Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< + NSEdgeInsets Function(ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_62_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_62_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_62_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_62 = __objc_msgSend_62Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __objc_msgSend_62_variant = + __objc_msgSend_62_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); late final _sel_keyPathsForValuesAffectingValueForKey_1 = _registerName1("keyPathsForValuesAffectingValueForKey:"); @@ -4392,11 +4484,29 @@ class SwiftLibrary { late final __objc_msgSend_165Ptr = _lookup< ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Double Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_165 = __objc_msgSend_165Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_165_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_165_variant( + obj, + sel, + ); + } + + late final __objc_msgSend_165_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_165_variant = + __objc_msgSend_165_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + late final _sel_initWithTimeIntervalSinceReferenceDate_1 = _registerName1("initWithTimeIntervalSinceReferenceDate:"); instancetype _objc_msgSend_166( @@ -4436,11 +4546,32 @@ class SwiftLibrary { late final __objc_msgSend_167Ptr = _lookup< ffi.NativeFunction< ffi.Double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_167_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer anotherDate, + ) { + return __objc_msgSend_167_variant( + obj, + sel, + anotherDate, + ); + } + + late final __objc_msgSend_167_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_167_variant = + __objc_msgSend_167_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + late final _sel_timeIntervalSinceNow1 = _registerName1("timeIntervalSinceNow"); late final _sel_timeIntervalSince19701 = @@ -6301,11 +6432,29 @@ class SwiftLibrary { late final __objc_msgSend_239Ptr = _lookup< ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Float Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_239 = __objc_msgSend_239Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_239_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_239_variant( + obj, + sel, + ); + } + + late final __objc_msgSend_239_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_239_variant = + __objc_msgSend_239_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer)>(); + late final _sel_doubleValue1 = _registerName1("doubleValue"); late final _sel_boolValue1 = _registerName1("boolValue"); late final _sel_integerValue1 = _registerName1("integerValue"); @@ -7250,8 +7399,7 @@ class SwiftLibrary { late final _sel_rangeOfData_options_range_1 = _registerName1("rangeOfData:options:range:"); - void _objc_msgSend_271( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_271( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer dataToFind, @@ -7259,7 +7407,6 @@ class SwiftLibrary { _NSRange searchRange, ) { return __objc_msgSend_271( - stret, obj, sel, dataToFind, @@ -7269,6 +7416,32 @@ class SwiftLibrary { } late final __objc_msgSend_271Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_271 = __objc_msgSend_271Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + void _objc_msgSend_271_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer dataToFind, + int mask, + _NSRange searchRange, + ) { + return __objc_msgSend_271_variant( + stret, + obj, + sel, + dataToFind, + mask, + searchRange, + ); + } + + late final __objc_msgSend_271_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -7277,9 +7450,10 @@ class SwiftLibrary { ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_271 = __objc_msgSend_271Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + late final __objc_msgSend_271_variant = + __objc_msgSend_271_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); late final _sel_enumerateByteRangesUsingBlock_1 = _registerName1("enumerateByteRangesUsingBlock:"); @@ -8196,11 +8370,32 @@ class SwiftLibrary { late final __objc_msgSend_307Ptr = _lookup< ffi.NativeFunction< ffi.Float Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_307 = __objc_msgSend_307Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_307_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_307_variant( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_307_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_307_variant = + __objc_msgSend_307_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + late final _sel_decodeDoubleForKey_1 = _registerName1("decodeDoubleForKey:"); double _objc_msgSend_308( ffi.Pointer obj, @@ -8217,11 +8412,32 @@ class SwiftLibrary { late final __objc_msgSend_308Ptr = _lookup< ffi.NativeFunction< ffi.Double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); + ffi.Pointer)>>('objc_msgSend'); late final __objc_msgSend_308 = __objc_msgSend_308Ptr.asFunction< double Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + double _objc_msgSend_308_variant( + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_308_variant( + obj, + sel, + key, + ); + } + + late final __objc_msgSend_308_variantPtr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend_fpret'); + late final __objc_msgSend_308_variant = + __objc_msgSend_308_variantPtr.asFunction< + double Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + late final _sel_decodeBytesForKey_returnedLength_1 = _registerName1("decodeBytesForKey:returnedLength:"); ffi.Pointer _objc_msgSend_309( @@ -8754,14 +8970,12 @@ class SwiftLibrary { ffi.Pointer)>(); late final _sel_decodePointForKey_1 = _registerName1("decodePointForKey:"); - void _objc_msgSend_329( - ffi.Pointer stret, + CGPoint _objc_msgSend_329( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer key, ) { return __objc_msgSend_329( - stret, obj, sel, key, @@ -8769,25 +8983,46 @@ class SwiftLibrary { } late final __objc_msgSend_329Ptr = _lookup< + ffi.NativeFunction< + CGPoint Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_329 = __objc_msgSend_329Ptr.asFunction< + CGPoint Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_329_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_329_variant( + stret, + obj, + sel, + key, + ); + } + + late final __objc_msgSend_329_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_329 = __objc_msgSend_329Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_329_variant = + __objc_msgSend_329_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_decodeSizeForKey_1 = _registerName1("decodeSizeForKey:"); - void _objc_msgSend_330( - ffi.Pointer stret, + CGSize _objc_msgSend_330( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer key, ) { return __objc_msgSend_330( - stret, obj, sel, key, @@ -8795,25 +9030,46 @@ class SwiftLibrary { } late final __objc_msgSend_330Ptr = _lookup< + ffi.NativeFunction< + CGSize Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_330 = __objc_msgSend_330Ptr.asFunction< + CGSize Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_330_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_330_variant( + stret, + obj, + sel, + key, + ); + } + + late final __objc_msgSend_330_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_330 = __objc_msgSend_330Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_330_variant = + __objc_msgSend_330_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_decodeRectForKey_1 = _registerName1("decodeRectForKey:"); - void _objc_msgSend_331( - ffi.Pointer stret, + CGRect _objc_msgSend_331( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer key, ) { return __objc_msgSend_331( - stret, obj, sel, key, @@ -8821,15 +9077,38 @@ class SwiftLibrary { } late final __objc_msgSend_331Ptr = _lookup< + ffi.NativeFunction< + CGRect Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_331 = __objc_msgSend_331Ptr.asFunction< + CGRect Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_331_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer key, + ) { + return __objc_msgSend_331_variant( + stret, + obj, + sel, + key, + ); + } + + late final __objc_msgSend_331_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_331 = __objc_msgSend_331Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_331_variant = + __objc_msgSend_331_variantPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_substringFromIndex_1 = _registerName1("substringFromIndex:"); ffi.Pointer _objc_msgSend_332( @@ -9044,14 +9323,12 @@ class SwiftLibrary { _registerName1("localizedStandardContainsString:"); late final _sel_localizedStandardRangeOfString_1 = _registerName1("localizedStandardRangeOfString:"); - void _objc_msgSend_340( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_340( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer str, ) { return __objc_msgSend_340( - stret, obj, sel, str, @@ -9059,28 +9336,49 @@ class SwiftLibrary { } late final __objc_msgSend_340Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_340 = __objc_msgSend_340Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_340_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer str, + ) { + return __objc_msgSend_340_variant( + stret, + obj, + sel, + str, + ); + } + + late final __objc_msgSend_340_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_340 = __objc_msgSend_340Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_340_variant = + __objc_msgSend_340_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_rangeOfString_1 = _registerName1("rangeOfString:"); late final _sel_rangeOfString_options_1 = _registerName1("rangeOfString:options:"); - void _objc_msgSend_341( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_341( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchString, int mask, ) { return __objc_msgSend_341( - stret, obj, sel, searchString, @@ -9089,6 +9387,30 @@ class SwiftLibrary { } late final __objc_msgSend_341Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_341 = __objc_msgSend_341Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + void _objc_msgSend_341_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + ) { + return __objc_msgSend_341_variant( + stret, + obj, + sel, + searchString, + mask, + ); + } + + late final __objc_msgSend_341_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9096,14 +9418,14 @@ class SwiftLibrary { ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend_stret'); - late final __objc_msgSend_341 = __objc_msgSend_341Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + late final __objc_msgSend_341_variant = + __objc_msgSend_341_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); late final _sel_rangeOfString_options_range_1 = _registerName1("rangeOfString:options:range:"); - void _objc_msgSend_342( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_342( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchString, @@ -9111,7 +9433,6 @@ class SwiftLibrary { _NSRange rangeOfReceiverToSearch, ) { return __objc_msgSend_342( - stret, obj, sel, searchString, @@ -9121,6 +9442,32 @@ class SwiftLibrary { } late final __objc_msgSend_342Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_342 = __objc_msgSend_342Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + void _objc_msgSend_342_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + _NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_342_variant( + stret, + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_342_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9129,14 +9476,14 @@ class SwiftLibrary { ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_342 = __objc_msgSend_342Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + late final __objc_msgSend_342_variant = + __objc_msgSend_342_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); late final _sel_rangeOfString_options_range_locale_1 = _registerName1("rangeOfString:options:range:locale:"); - void _objc_msgSend_343( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_343( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchString, @@ -9145,7 +9492,6 @@ class SwiftLibrary { ffi.Pointer locale, ) { return __objc_msgSend_343( - stret, obj, sel, searchString, @@ -9156,6 +9502,39 @@ class SwiftLibrary { } late final __objc_msgSend_343Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + _NSRange, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_343 = __objc_msgSend_343Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange, ffi.Pointer)>(); + + void _objc_msgSend_343_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchString, + int mask, + _NSRange rangeOfReceiverToSearch, + ffi.Pointer locale, + ) { + return __objc_msgSend_343_variant( + stret, + obj, + sel, + searchString, + mask, + rangeOfReceiverToSearch, + locale, + ); + } + + late final __objc_msgSend_343_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9165,26 +9544,25 @@ class SwiftLibrary { ffi.Int32, _NSRange, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_343 = __objc_msgSend_343Ptr.asFunction< - void Function( - ffi.Pointer<_NSRange>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _NSRange, - ffi.Pointer)>(); + late final __objc_msgSend_343_variant = + __objc_msgSend_343_variantPtr.asFunction< + void Function( + ffi.Pointer<_NSRange>, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + _NSRange, + ffi.Pointer)>(); late final _sel_rangeOfCharacterFromSet_1 = _registerName1("rangeOfCharacterFromSet:"); - void _objc_msgSend_344( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_344( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchSet, ) { return __objc_msgSend_344( - stret, obj, sel, searchSet, @@ -9192,27 +9570,48 @@ class SwiftLibrary { } late final __objc_msgSend_344Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_344 = __objc_msgSend_344Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); + + void _objc_msgSend_344_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + ) { + return __objc_msgSend_344_variant( + stret, + obj, + sel, + searchSet, + ); + } + + late final __objc_msgSend_344_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_344 = __objc_msgSend_344Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_344_variant = + __objc_msgSend_344_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_rangeOfCharacterFromSet_options_1 = _registerName1("rangeOfCharacterFromSet:options:"); - void _objc_msgSend_345( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_345( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchSet, int mask, ) { return __objc_msgSend_345( - stret, obj, sel, searchSet, @@ -9221,6 +9620,30 @@ class SwiftLibrary { } late final __objc_msgSend_345Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_345 = __objc_msgSend_345Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); + + void _objc_msgSend_345_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + ) { + return __objc_msgSend_345_variant( + stret, + obj, + sel, + searchSet, + mask, + ); + } + + late final __objc_msgSend_345_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9228,14 +9651,14 @@ class SwiftLibrary { ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend_stret'); - late final __objc_msgSend_345 = __objc_msgSend_345Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + late final __objc_msgSend_345_variant = + __objc_msgSend_345_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); late final _sel_rangeOfCharacterFromSet_options_range_1 = _registerName1("rangeOfCharacterFromSet:options:range:"); - void _objc_msgSend_346( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_346( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer searchSet, @@ -9243,7 +9666,6 @@ class SwiftLibrary { _NSRange rangeOfReceiverToSearch, ) { return __objc_msgSend_346( - stret, obj, sel, searchSet, @@ -9253,6 +9675,32 @@ class SwiftLibrary { } late final __objc_msgSend_346Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_346 = __objc_msgSend_346Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + void _objc_msgSend_346_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer searchSet, + int mask, + _NSRange rangeOfReceiverToSearch, + ) { + return __objc_msgSend_346_variant( + stret, + obj, + sel, + searchSet, + mask, + rangeOfReceiverToSearch, + ); + } + + late final __objc_msgSend_346_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -9261,20 +9709,19 @@ class SwiftLibrary { ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_346 = __objc_msgSend_346Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + late final __objc_msgSend_346_variant = + __objc_msgSend_346_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); late final _sel_rangeOfComposedCharacterSequenceAtIndex_1 = _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); - void _objc_msgSend_347( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_347( ffi.Pointer obj, ffi.Pointer sel, int index, ) { return __objc_msgSend_347( - stret, obj, sel, index, @@ -9282,23 +9729,43 @@ class SwiftLibrary { } late final __objc_msgSend_347Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedLong)>>('objc_msgSend'); + late final __objc_msgSend_347 = __objc_msgSend_347Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + + void _objc_msgSend_347_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + int index, + ) { + return __objc_msgSend_347_variant( + stret, + obj, + sel, + index, + ); + } + + late final __objc_msgSend_347_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend_stret'); - late final __objc_msgSend_347 = __objc_msgSend_347Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, int)>(); + late final __objc_msgSend_347_variant = + __objc_msgSend_347_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int)>(); late final _sel_rangeOfComposedCharacterSequencesForRange_1 = _registerName1("rangeOfComposedCharacterSequencesForRange:"); - void _objc_msgSend_348( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_348( ffi.Pointer obj, ffi.Pointer sel, _NSRange range, ) { return __objc_msgSend_348( - stret, obj, sel, range, @@ -9306,12 +9773,35 @@ class SwiftLibrary { } late final __objc_msgSend_348Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_348 = __objc_msgSend_348Ptr.asFunction< + _NSRange Function( + ffi.Pointer, ffi.Pointer, _NSRange)>(); + + void _objc_msgSend_348_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + _NSRange range, + ) { + return __objc_msgSend_348_variant( + stret, + obj, + sel, + range, + ); + } + + late final __objc_msgSend_348_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_348 = __objc_msgSend_348Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, _NSRange)>(); + late final __objc_msgSend_348_variant = + __objc_msgSend_348_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, _NSRange)>(); late final _sel_stringByAppendingString_1 = _registerName1("stringByAppendingString:"); @@ -21316,14 +21806,12 @@ class SwiftLibrary { late final _sel_AMSymbol1 = _registerName1("AMSymbol"); late final _sel_PMSymbol1 = _registerName1("PMSymbol"); late final _sel_minimumRangeOfUnit_1 = _registerName1("minimumRangeOfUnit:"); - void _objc_msgSend_767( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_767( ffi.Pointer obj, ffi.Pointer sel, int unit, ) { return __objc_msgSend_767( - stret, obj, sel, unit, @@ -21331,18 +21819,39 @@ class SwiftLibrary { } late final __objc_msgSend_767Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('objc_msgSend'); + late final __objc_msgSend_767 = __objc_msgSend_767Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + + void _objc_msgSend_767_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + int unit, + ) { + return __objc_msgSend_767_variant( + stret, + obj, + sel, + unit, + ); + } + + late final __objc_msgSend_767_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer<_NSRange>, ffi.Pointer, ffi.Pointer, ffi.Int32)>>('objc_msgSend_stret'); - late final __objc_msgSend_767 = __objc_msgSend_767Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, int)>(); + late final __objc_msgSend_767_variant = + __objc_msgSend_767_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int)>(); late final _sel_maximumRangeOfUnit_1 = _registerName1("maximumRangeOfUnit:"); late final _sel_rangeOfUnit_inUnit_forDate_1 = _registerName1("rangeOfUnit:inUnit:forDate:"); - void _objc_msgSend_768( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_768( ffi.Pointer obj, ffi.Pointer sel, int smaller, @@ -21350,7 +21859,6 @@ class SwiftLibrary { ffi.Pointer date, ) { return __objc_msgSend_768( - stret, obj, sel, smaller, @@ -21360,6 +21868,32 @@ class SwiftLibrary { } late final __objc_msgSend_768Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_768 = __objc_msgSend_768Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, int, int, + ffi.Pointer)>(); + + void _objc_msgSend_768_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + int smaller, + int larger, + ffi.Pointer date, + ) { + return __objc_msgSend_768_variant( + stret, + obj, + sel, + smaller, + larger, + date, + ); + } + + late final __objc_msgSend_768_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -21368,9 +21902,10 @@ class SwiftLibrary { ffi.Int32, ffi.Int32, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_768 = __objc_msgSend_768Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); + late final __objc_msgSend_768_variant = + __objc_msgSend_768_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); late final _sel_ordinalityOfUnit_inUnit_forDate_1 = _registerName1("ordinalityOfUnit:inUnit:forDate:"); @@ -26197,27 +26732,46 @@ class SwiftLibrary { _registerName1("operatingSystemVersionString"); late final _sel_operatingSystemVersion1 = _registerName1("operatingSystemVersion"); - void _objc_msgSend_940( - ffi.Pointer stret, + NSOperatingSystemVersion _objc_msgSend_940( ffi.Pointer obj, ffi.Pointer sel, ) { return __objc_msgSend_940( - stret, obj, sel, ); } late final __objc_msgSend_940Ptr = _lookup< + ffi.NativeFunction< + NSOperatingSystemVersion Function( + ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); + late final __objc_msgSend_940 = __objc_msgSend_940Ptr.asFunction< + NSOperatingSystemVersion Function( + ffi.Pointer, ffi.Pointer)>(); + + void _objc_msgSend_940_variant( + ffi.Pointer stret, + ffi.Pointer obj, + ffi.Pointer sel, + ) { + return __objc_msgSend_940_variant( + stret, + obj, + sel, + ); + } + + late final __objc_msgSend_940_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('objc_msgSend_stret'); - late final __objc_msgSend_940 = __objc_msgSend_940Ptr.asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final __objc_msgSend_940_variant = + __objc_msgSend_940_variantPtr.asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); late final _sel_processorCount1 = _registerName1("processorCount"); late final _sel_activeProcessorCount1 = @@ -26628,8 +27182,7 @@ class SwiftLibrary { late final _sel_rangeOfFirstMatchInString_options_range_1 = _registerName1("rangeOfFirstMatchInString:options:range:"); - void _objc_msgSend_955( - ffi.Pointer<_NSRange> stret, + _NSRange _objc_msgSend_955( ffi.Pointer obj, ffi.Pointer sel, ffi.Pointer string, @@ -26637,7 +27190,6 @@ class SwiftLibrary { _NSRange range, ) { return __objc_msgSend_955( - stret, obj, sel, string, @@ -26647,6 +27199,32 @@ class SwiftLibrary { } late final __objc_msgSend_955Ptr = _lookup< + ffi.NativeFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend'); + late final __objc_msgSend_955 = __objc_msgSend_955Ptr.asFunction< + _NSRange Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, _NSRange)>(); + + void _objc_msgSend_955_variant( + ffi.Pointer<_NSRange> stret, + ffi.Pointer obj, + ffi.Pointer sel, + ffi.Pointer string, + int options, + _NSRange range, + ) { + return __objc_msgSend_955_variant( + stret, + obj, + sel, + string, + options, + range, + ); + } + + late final __objc_msgSend_955_variantPtr = _lookup< ffi.NativeFunction< ffi.Void Function( ffi.Pointer<_NSRange>, @@ -26655,9 +27233,10 @@ class SwiftLibrary { ffi.Pointer, ffi.Int32, _NSRange)>>('objc_msgSend_stret'); - late final __objc_msgSend_955 = __objc_msgSend_955Ptr.asFunction< - void Function(ffi.Pointer<_NSRange>, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, _NSRange)>(); + late final __objc_msgSend_955_variant = + __objc_msgSend_955_variantPtr.asFunction< + void Function(ffi.Pointer<_NSRange>, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, _NSRange)>(); late final _sel_stringByReplacingMatchesInString_options_range_withTemplate_1 = _registerName1( @@ -33858,25 +34437,46 @@ class NSString extends NSObject { void localizedStandardRangeOfString_( ffi.Pointer<_NSRange> stret, NSString str) { - _lib._objc_msgSend_340( - stret, _id, _lib._sel_localizedStandardRangeOfString_1, str._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_340_variant( + stret, _id, _lib._sel_localizedStandardRangeOfString_1, str._id) + : stret.ref = _lib._objc_msgSend_340( + _id, _lib._sel_localizedStandardRangeOfString_1, str._id); } void rangeOfString_(ffi.Pointer<_NSRange> stret, NSString searchString) { - _lib._objc_msgSend_340( - stret, _id, _lib._sel_rangeOfString_1, searchString._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_340_variant( + stret, _id, _lib._sel_rangeOfString_1, searchString._id) + : stret.ref = _lib._objc_msgSend_340( + _id, _lib._sel_rangeOfString_1, searchString._id); } void rangeOfString_options_( ffi.Pointer<_NSRange> stret, NSString searchString, int mask) { - _lib._objc_msgSend_341( - stret, _id, _lib._sel_rangeOfString_options_1, searchString._id, mask); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_341_variant(stret, _id, + _lib._sel_rangeOfString_options_1, searchString._id, mask) + : stret.ref = _lib._objc_msgSend_341( + _id, _lib._sel_rangeOfString_options_1, searchString._id, mask); } void rangeOfString_options_range_(ffi.Pointer<_NSRange> stret, NSString searchString, int mask, _NSRange rangeOfReceiverToSearch) { - _lib._objc_msgSend_342(stret, _id, _lib._sel_rangeOfString_options_range_1, - searchString._id, mask, rangeOfReceiverToSearch); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_342_variant( + stret, + _id, + _lib._sel_rangeOfString_options_range_1, + searchString._id, + mask, + rangeOfReceiverToSearch) + : stret.ref = _lib._objc_msgSend_342( + _id, + _lib._sel_rangeOfString_options_range_1, + searchString._id, + mask, + rangeOfReceiverToSearch); } void rangeOfString_options_range_locale_( @@ -33885,49 +34485,76 @@ class NSString extends NSObject { int mask, _NSRange rangeOfReceiverToSearch, NSLocale? locale) { - _lib._objc_msgSend_343( - stret, - _id, - _lib._sel_rangeOfString_options_range_locale_1, - searchString._id, - mask, - rangeOfReceiverToSearch, - locale?._id ?? ffi.nullptr); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_343_variant( + stret, + _id, + _lib._sel_rangeOfString_options_range_locale_1, + searchString._id, + mask, + rangeOfReceiverToSearch, + locale?._id ?? ffi.nullptr) + : stret.ref = _lib._objc_msgSend_343( + _id, + _lib._sel_rangeOfString_options_range_locale_1, + searchString._id, + mask, + rangeOfReceiverToSearch, + locale?._id ?? ffi.nullptr); } void rangeOfCharacterFromSet_( ffi.Pointer<_NSRange> stret, NSCharacterSet searchSet) { - _lib._objc_msgSend_344( - stret, _id, _lib._sel_rangeOfCharacterFromSet_1, searchSet._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_344_variant( + stret, _id, _lib._sel_rangeOfCharacterFromSet_1, searchSet._id) + : stret.ref = _lib._objc_msgSend_344( + _id, _lib._sel_rangeOfCharacterFromSet_1, searchSet._id); } void rangeOfCharacterFromSet_options_( ffi.Pointer<_NSRange> stret, NSCharacterSet searchSet, int mask) { - _lib._objc_msgSend_345(stret, _id, - _lib._sel_rangeOfCharacterFromSet_options_1, searchSet._id, mask); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_345_variant(stret, _id, + _lib._sel_rangeOfCharacterFromSet_options_1, searchSet._id, mask) + : stret.ref = _lib._objc_msgSend_345(_id, + _lib._sel_rangeOfCharacterFromSet_options_1, searchSet._id, mask); } void rangeOfCharacterFromSet_options_range_(ffi.Pointer<_NSRange> stret, NSCharacterSet searchSet, int mask, _NSRange rangeOfReceiverToSearch) { - _lib._objc_msgSend_346( - stret, - _id, - _lib._sel_rangeOfCharacterFromSet_options_range_1, - searchSet._id, - mask, - rangeOfReceiverToSearch); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_346_variant( + stret, + _id, + _lib._sel_rangeOfCharacterFromSet_options_range_1, + searchSet._id, + mask, + rangeOfReceiverToSearch) + : stret.ref = _lib._objc_msgSend_346( + _id, + _lib._sel_rangeOfCharacterFromSet_options_range_1, + searchSet._id, + mask, + rangeOfReceiverToSearch); } void rangeOfComposedCharacterSequenceAtIndex_( ffi.Pointer<_NSRange> stret, int index) { - _lib._objc_msgSend_347( - stret, _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_347_variant(stret, _id, + _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index) + : stret.ref = _lib._objc_msgSend_347( + _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); } void rangeOfComposedCharacterSequencesForRange_( ffi.Pointer<_NSRange> stret, _NSRange range) { - _lib._objc_msgSend_348(stret, _id, - _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_348_variant(stret, _id, + _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range) + : stret.ref = _lib._objc_msgSend_348( + _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); } NSString stringByAppendingString_(NSString aString) { @@ -33943,11 +34570,15 @@ class NSString extends NSObject { } double get doubleValue { - return _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_doubleValue1) + : _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); } double get floatValue { - return _lib._objc_msgSend_239(_id, _lib._sel_floatValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_floatValue1) + : _lib._objc_msgSend_239(_id, _lib._sel_floatValue1); } int get intValue { @@ -34032,7 +34663,11 @@ class NSString extends NSObject { } void lineRangeForRange_(ffi.Pointer<_NSRange> stret, _NSRange range) { - _lib._objc_msgSend_348(stret, _id, _lib._sel_lineRangeForRange_1, range); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_348_variant( + stret, _id, _lib._sel_lineRangeForRange_1, range) + : stret.ref = + _lib._objc_msgSend_348(_id, _lib._sel_lineRangeForRange_1, range); } void getParagraphStart_end_contentsEnd_forRange_( @@ -34050,8 +34685,11 @@ class NSString extends NSObject { } void paragraphRangeForRange_(ffi.Pointer<_NSRange> stret, _NSRange range) { - _lib._objc_msgSend_348( - stret, _id, _lib._sel_paragraphRangeForRange_1, range); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_348_variant( + stret, _id, _lib._sel_paragraphRangeForRange_1, range) + : stret.ref = _lib._objc_msgSend_348( + _id, _lib._sel_paragraphRangeForRange_1, range); } void enumerateSubstringsInRange_options_usingBlock_(_NSRange range, int opts, @@ -35344,11 +35982,17 @@ class NSCoder extends NSObject { } double decodeFloatForKey_(NSString key) { - return _lib._objc_msgSend_307(_id, _lib._sel_decodeFloatForKey_1, key._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_307_variant( + _id, _lib._sel_decodeFloatForKey_1, key._id) + : _lib._objc_msgSend_307(_id, _lib._sel_decodeFloatForKey_1, key._id); } double decodeDoubleForKey_(NSString key) { - return _lib._objc_msgSend_308(_id, _lib._sel_decodeDoubleForKey_1, key._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_308_variant( + _id, _lib._sel_decodeDoubleForKey_1, key._id) + : _lib._objc_msgSend_308(_id, _lib._sel_decodeDoubleForKey_1, key._id); } ffi.Pointer decodeBytesForKey_returnedLength_( @@ -35510,7 +36154,9 @@ class NSCoder extends NSObject { } void decodePoint(ffi.Pointer stret) { - _lib._objc_msgSend_59(stret, _id, _lib._sel_decodePoint1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_59_variant(stret, _id, _lib._sel_decodePoint1) + : stret.ref = _lib._objc_msgSend_59(_id, _lib._sel_decodePoint1); } void encodeSize_(CGSize size) { @@ -35518,7 +36164,9 @@ class NSCoder extends NSObject { } void decodeSize(ffi.Pointer stret) { - _lib._objc_msgSend_60(stret, _id, _lib._sel_decodeSize1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_60_variant(stret, _id, _lib._sel_decodeSize1) + : stret.ref = _lib._objc_msgSend_60(_id, _lib._sel_decodeSize1); } void encodeRect_(CGRect rect) { @@ -35526,7 +36174,9 @@ class NSCoder extends NSObject { } void decodeRect(ffi.Pointer stret) { - _lib._objc_msgSend_61(stret, _id, _lib._sel_decodeRect1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_61_variant(stret, _id, _lib._sel_decodeRect1) + : stret.ref = _lib._objc_msgSend_61(_id, _lib._sel_decodeRect1); } void encodePoint_forKey_(CGPoint point, NSString key) { @@ -35542,15 +36192,27 @@ class NSCoder extends NSObject { } void decodePointForKey_(ffi.Pointer stret, NSString key) { - _lib._objc_msgSend_329(stret, _id, _lib._sel_decodePointForKey_1, key._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_329_variant( + stret, _id, _lib._sel_decodePointForKey_1, key._id) + : stret.ref = + _lib._objc_msgSend_329(_id, _lib._sel_decodePointForKey_1, key._id); } void decodeSizeForKey_(ffi.Pointer stret, NSString key) { - _lib._objc_msgSend_330(stret, _id, _lib._sel_decodeSizeForKey_1, key._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_330_variant( + stret, _id, _lib._sel_decodeSizeForKey_1, key._id) + : stret.ref = + _lib._objc_msgSend_330(_id, _lib._sel_decodeSizeForKey_1, key._id); } void decodeRectForKey_(ffi.Pointer stret, NSString key) { - _lib._objc_msgSend_331(stret, _id, _lib._sel_decodeRectForKey_1, key._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_331_variant( + stret, _id, _lib._sel_decodeRectForKey_1, key._id) + : stret.ref = + _lib._objc_msgSend_331(_id, _lib._sel_decodeRectForKey_1, key._id); } @override @@ -35716,8 +36378,20 @@ class NSData extends NSObject { void rangeOfData_options_range_(ffi.Pointer<_NSRange> stret, NSData dataToFind, int mask, _NSRange searchRange) { - _lib._objc_msgSend_271(stret, _id, _lib._sel_rangeOfData_options_range_1, - dataToFind._id, mask, searchRange); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_271_variant( + stret, + _id, + _lib._sel_rangeOfData_options_range_1, + dataToFind._id, + mask, + searchRange) + : stret.ref = _lib._objc_msgSend_271( + _id, + _lib._sel_rangeOfData_options_range_1, + dataToFind._id, + mask, + searchRange); } void enumerateByteRangesUsingBlock_( @@ -37017,11 +37691,15 @@ class NSNumber extends NSValue { } double get floatValue { - return _lib._objc_msgSend_239(_id, _lib._sel_floatValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_floatValue1) + : _lib._objc_msgSend_239(_id, _lib._sel_floatValue1); } double get doubleValue { - return _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_doubleValue1) + : _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); } bool get boolValue { @@ -37397,7 +38075,9 @@ class NSValue extends NSObject { } void getRangeValue(ffi.Pointer<_NSRange> stret) { - _lib._objc_msgSend_54(stret, _id, _lib._sel_rangeValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_54_variant(stret, _id, _lib._sel_rangeValue1) + : stret.ref = _lib._objc_msgSend_54(_id, _lib._sel_rangeValue1); } static NSValue valueWithPoint_(SwiftLibrary _lib, CGPoint point) { @@ -37425,19 +38105,27 @@ class NSValue extends NSObject { } void getPointValue(ffi.Pointer stret) { - _lib._objc_msgSend_59(stret, _id, _lib._sel_pointValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_59_variant(stret, _id, _lib._sel_pointValue1) + : stret.ref = _lib._objc_msgSend_59(_id, _lib._sel_pointValue1); } void getSizeValue(ffi.Pointer stret) { - _lib._objc_msgSend_60(stret, _id, _lib._sel_sizeValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_60_variant(stret, _id, _lib._sel_sizeValue1) + : stret.ref = _lib._objc_msgSend_60(_id, _lib._sel_sizeValue1); } void getRectValue(ffi.Pointer stret) { - _lib._objc_msgSend_61(stret, _id, _lib._sel_rectValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_61_variant(stret, _id, _lib._sel_rectValue1) + : stret.ref = _lib._objc_msgSend_61(_id, _lib._sel_rectValue1); } void getEdgeInsetsValue(ffi.Pointer stret) { - _lib._objc_msgSend_62(stret, _id, _lib._sel_edgeInsetsValue1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_62_variant(stret, _id, _lib._sel_edgeInsetsValue1) + : stret.ref = _lib._objc_msgSend_62(_id, _lib._sel_edgeInsetsValue1); } @override @@ -40822,8 +41510,11 @@ class NSDate extends NSObject { } double get timeIntervalSinceReferenceDate { - return _lib._objc_msgSend_165( - _id, _lib._sel_timeIntervalSinceReferenceDate1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_timeIntervalSinceReferenceDate1) + : _lib._objc_msgSend_165( + _id, _lib._sel_timeIntervalSinceReferenceDate1); } @override @@ -40847,16 +41538,23 @@ class NSDate extends NSObject { } double timeIntervalSinceDate_(NSDate anotherDate) { - return _lib._objc_msgSend_167( - _id, _lib._sel_timeIntervalSinceDate_1, anotherDate._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_167_variant( + _id, _lib._sel_timeIntervalSinceDate_1, anotherDate._id) + : _lib._objc_msgSend_167( + _id, _lib._sel_timeIntervalSinceDate_1, anotherDate._id); } double get timeIntervalSinceNow { - return _lib._objc_msgSend_165(_id, _lib._sel_timeIntervalSinceNow1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeIntervalSinceNow1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeIntervalSinceNow1); } double get timeIntervalSince1970 { - return _lib._objc_msgSend_165(_id, _lib._sel_timeIntervalSince19701); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeIntervalSince19701) + : _lib._objc_msgSend_165(_id, _lib._sel_timeIntervalSince19701); } NSObject addTimeInterval_(double seconds) { @@ -41610,8 +42308,11 @@ class NSTimeZone extends NSObject { } double daylightSavingTimeOffsetForDate_(NSDate aDate) { - return _lib._objc_msgSend_167( - _id, _lib._sel_daylightSavingTimeOffsetForDate_1, aDate._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_167_variant( + _id, _lib._sel_daylightSavingTimeOffsetForDate_1, aDate._id) + : _lib._objc_msgSend_167( + _id, _lib._sel_daylightSavingTimeOffsetForDate_1, aDate._id); } NSDate? nextDaylightSavingTimeTransitionAfterDate_(NSDate aDate) { @@ -41689,7 +42390,10 @@ class NSTimeZone extends NSObject { } double get daylightSavingTimeOffset { - return _lib._objc_msgSend_165(_id, _lib._sel_daylightSavingTimeOffset1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_daylightSavingTimeOffset1) + : _lib._objc_msgSend_165(_id, _lib._sel_daylightSavingTimeOffset1); } NSDate? get nextDaylightSavingTimeTransition { @@ -47516,7 +48220,9 @@ class NSThread extends NSObject { } double get threadPriority { - return _lib._objc_msgSend_165(_id, _lib._sel_threadPriority1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_threadPriority1) + : _lib._objc_msgSend_165(_id, _lib._sel_threadPriority1); } set threadPriority(double value) { @@ -49001,11 +49707,15 @@ class NSTimer extends NSObject { } double get timeInterval { - return _lib._objc_msgSend_165(_id, _lib._sel_timeInterval1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeInterval1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeInterval1); } double get tolerance { - return _lib._objc_msgSend_165(_id, _lib._sel_tolerance1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_tolerance1) + : _lib._objc_msgSend_165(_id, _lib._sel_tolerance1); } set tolerance(double value) { @@ -49343,7 +50053,9 @@ class NSConnection extends NSObject { } double get requestTimeout { - return _lib._objc_msgSend_165(_id, _lib._sel_requestTimeout1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_requestTimeout1) + : _lib._objc_msgSend_165(_id, _lib._sel_requestTimeout1); } set requestTimeout(double value) { @@ -49351,7 +50063,9 @@ class NSConnection extends NSObject { } double get replyTimeout { - return _lib._objc_msgSend_165(_id, _lib._sel_replyTimeout1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_replyTimeout1) + : _lib._objc_msgSend_165(_id, _lib._sel_replyTimeout1); } set replyTimeout(double value) { @@ -50605,7 +51319,9 @@ class NSAppleEventDescriptor extends NSObject { } double get doubleValue { - return _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_doubleValue1) + : _lib._objc_msgSend_165(_id, _lib._sel_doubleValue1); } int get typeCodeValue { @@ -52236,7 +52952,9 @@ class NSProgress extends NSObject { } double get fractionCompleted { - return _lib._objc_msgSend_165(_id, _lib._sel_fractionCompleted1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_fractionCompleted1) + : _lib._objc_msgSend_165(_id, _lib._sel_fractionCompleted1); } bool get finished { @@ -54907,8 +55625,11 @@ class NSBundle extends NSObject { } double preservationPriorityForTag_(NSString tag) { - return _lib._objc_msgSend_308( - _id, _lib._sel_preservationPriorityForTag_1, tag._id); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_308_variant( + _id, _lib._sel_preservationPriorityForTag_1, tag._id) + : _lib._objc_msgSend_308( + _id, _lib._sel_preservationPriorityForTag_1, tag._id); } @override @@ -57163,17 +57884,28 @@ class NSCalendar extends NSObject { } void minimumRangeOfUnit_(ffi.Pointer<_NSRange> stret, int unit) { - _lib._objc_msgSend_767(stret, _id, _lib._sel_minimumRangeOfUnit_1, unit); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_767_variant( + stret, _id, _lib._sel_minimumRangeOfUnit_1, unit) + : stret.ref = + _lib._objc_msgSend_767(_id, _lib._sel_minimumRangeOfUnit_1, unit); } void maximumRangeOfUnit_(ffi.Pointer<_NSRange> stret, int unit) { - _lib._objc_msgSend_767(stret, _id, _lib._sel_maximumRangeOfUnit_1, unit); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_767_variant( + stret, _id, _lib._sel_maximumRangeOfUnit_1, unit) + : stret.ref = + _lib._objc_msgSend_767(_id, _lib._sel_maximumRangeOfUnit_1, unit); } void rangeOfUnit_inUnit_forDate_( ffi.Pointer<_NSRange> stret, int smaller, int larger, NSDate date) { - _lib._objc_msgSend_768(stret, _id, _lib._sel_rangeOfUnit_inUnit_forDate_1, - smaller, larger, date._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_768_variant(stret, _id, + _lib._sel_rangeOfUnit_inUnit_forDate_1, smaller, larger, date._id) + : stret.ref = _lib._objc_msgSend_768(_id, + _lib._sel_rangeOfUnit_inUnit_forDate_1, smaller, larger, date._id); } int ordinalityOfUnit_inUnit_forDate_(int smaller, int larger, NSDate date) { @@ -60596,7 +61328,9 @@ class NSURLSessionTask extends NSObject { } double get priority { - return _lib._objc_msgSend_239(_id, _lib._sel_priority1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_239_variant(_id, _lib._sel_priority1) + : _lib._objc_msgSend_239(_id, _lib._sel_priority1); } set priority(double value) { @@ -60774,7 +61508,9 @@ class NSURLRequest extends NSObject { } double get timeoutInterval { - return _lib._objc_msgSend_165(_id, _lib._sel_timeoutInterval1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeoutInterval1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeoutInterval1); } NSURL? get mainDocumentURL { @@ -63152,7 +63888,9 @@ class NSOperation extends NSObject { } double get threadPriority { - return _lib._objc_msgSend_165(_id, _lib._sel_threadPriority1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_threadPriority1) + : _lib._objc_msgSend_165(_id, _lib._sel_threadPriority1); } set threadPriority(double value) { @@ -63851,7 +64589,11 @@ class NSProcessInfo extends NSObject { } void getOperatingSystemVersion(ffi.Pointer stret) { - _lib._objc_msgSend_940(stret, _id, _lib._sel_operatingSystemVersion1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_940_variant( + stret, _id, _lib._sel_operatingSystemVersion1) + : stret.ref = + _lib._objc_msgSend_940(_id, _lib._sel_operatingSystemVersion1); } int get processorCount { @@ -63872,7 +64614,9 @@ class NSProcessInfo extends NSObject { } double get systemUptime { - return _lib._objc_msgSend_165(_id, _lib._sel_systemUptime1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_systemUptime1) + : _lib._objc_msgSend_165(_id, _lib._sel_systemUptime1); } void disableSuddenTermination() { @@ -64200,7 +64944,9 @@ class NSTextCheckingResult extends NSObject { } void getRange(ffi.Pointer<_NSRange> stret) { - _lib._objc_msgSend_54(stret, _id, _lib._sel_range1); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_54_variant(stret, _id, _lib._sel_range1) + : stret.ref = _lib._objc_msgSend_54(_id, _lib._sel_range1); } NSOrthography? get orthography { @@ -64232,7 +64978,9 @@ class NSTextCheckingResult extends NSObject { } double get duration { - return _lib._objc_msgSend_165(_id, _lib._sel_duration1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_duration1) + : _lib._objc_msgSend_165(_id, _lib._sel_duration1); } NSDictionary? get components { @@ -64282,11 +65030,19 @@ class NSTextCheckingResult extends NSObject { } void rangeAtIndex_(ffi.Pointer<_NSRange> stret, int idx) { - _lib._objc_msgSend_347(stret, _id, _lib._sel_rangeAtIndex_1, idx); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_347_variant( + stret, _id, _lib._sel_rangeAtIndex_1, idx) + : stret.ref = + _lib._objc_msgSend_347(_id, _lib._sel_rangeAtIndex_1, idx); } void rangeWithName_(ffi.Pointer<_NSRange> stret, NSString name) { - _lib._objc_msgSend_340(stret, _id, _lib._sel_rangeWithName_1, name._id); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_340_variant( + stret, _id, _lib._sel_rangeWithName_1, name._id) + : stret.ref = + _lib._objc_msgSend_340(_id, _lib._sel_rangeWithName_1, name._id); } NSTextCheckingResult resultByAdjustingRangesWithOffset_(int offset) { @@ -64675,13 +65431,20 @@ class NSRegularExpression extends NSObject { void rangeOfFirstMatchInString_options_range_(ffi.Pointer<_NSRange> stret, NSString string, int options, _NSRange range) { - _lib._objc_msgSend_955( - stret, - _id, - _lib._sel_rangeOfFirstMatchInString_options_range_1, - string._id, - options, - range); + _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_955_variant( + stret, + _id, + _lib._sel_rangeOfFirstMatchInString_options_range_1, + string._id, + options, + range) + : stret.ref = _lib._objc_msgSend_955( + _id, + _lib._sel_rangeOfFirstMatchInString_options_range_1, + string._id, + options, + range); } NSString stringByReplacingMatchesInString_options_range_withTemplate_( @@ -67098,7 +67861,9 @@ class NSMutableURLRequest extends NSURLRequest { @override double get timeoutInterval { - return _lib._objc_msgSend_165(_id, _lib._sel_timeoutInterval1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant(_id, _lib._sel_timeoutInterval1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeoutInterval1); } set timeoutInterval(double value) { @@ -68425,7 +69190,10 @@ class NSURLSessionConfiguration extends NSObject { } double get timeoutIntervalForRequest { - return _lib._objc_msgSend_165(_id, _lib._sel_timeoutIntervalForRequest1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_timeoutIntervalForRequest1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeoutIntervalForRequest1); } set timeoutIntervalForRequest(double value) { @@ -68434,7 +69202,10 @@ class NSURLSessionConfiguration extends NSObject { } double get timeoutIntervalForResource { - return _lib._objc_msgSend_165(_id, _lib._sel_timeoutIntervalForResource1); + return _lib._objc_msgSend_useVariants1 + ? _lib._objc_msgSend_165_variant( + _id, _lib._sel_timeoutIntervalForResource1) + : _lib._objc_msgSend_165(_id, _lib._sel_timeoutIntervalForResource1); } set timeoutIntervalForResource(double value) { diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index 60c998b88..7b066f1a5 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart @@ -105,9 +105,19 @@ $objType $name(String name) { key += ' ${p.type.cacheKey()}'; } return _msgSendFuncs[key] ??= ObjCMsgSendFunc( - '_objc_msgSend_${_msgSendFuncs.length}', returnType, params); + '_objc_msgSend_${_msgSendFuncs.length}', + returnType, + params, + _msgSendUseVariants); } + late final _msgSendUseVariants = ObjCInternalGlobal( + '_objc_msgSend_useVariants', + (Writer w) => ''' +${w.ffiLibraryPrefix}.Abi.current() == ${w.ffiLibraryPrefix}.Abi.iosX64 || +${w.ffiLibraryPrefix}.Abi.current() == ${w.ffiLibraryPrefix}.Abi.macosX64 +'''); + final _selObjects = {}; ObjCInternalGlobal getSelObject(String methodName) { return _selObjects[methodName] ??= ObjCInternalGlobal( @@ -285,7 +295,7 @@ class $name implements ${w.ffiLibraryPrefix}.Finalizable { _releaseFunc.addDependencies(dependencies); _releaseFinalizer.addDependencies(dependencies); for (final msgSendFunc in _msgSendFuncs.values) { - msgSendFunc.func.addDependencies(dependencies); + msgSendFunc.addDependencies(dependencies); } for (final sel in _selObjects.values) { sel.addDependencies(dependencies); @@ -415,30 +425,110 @@ enum ObjCMsgSendVariant { } /// A wrapper around the objc_msgSend function, or the stret or fpret variants. +/// +/// The [variant] is based purely on the return type of the method. +/// +/// For the stret and fpret variants, we may need to fall back to the normal +/// objc_msgSend function at runtime, depending on the ABI. So we emit both the +/// variant function and the normal function, and decide which to use at runtime +/// based on the ABI. The result of the ABI check is stored in [useVariants]. +/// +/// This runtime check is complicated by the fact that objc_msgSend_stret has +/// a different signature than objc_msgSend has for the same method. This is +/// because objc_msgSend_stret takes a pointer to the return type as its first +/// arg. class ObjCMsgSendFunc { final ObjCMsgSendVariant variant; - late final Func func; + final ObjCInternalGlobal useVariants; + + // [normalFunc] is always a reference to the normal objc_msgSend function. If + // the [variant] is fpret or stret, then [variantFunc] is a reference to the + // corresponding variant of the objc_msgSend function, otherwise it's null. + late final Func normalFunc; + late final Func? variantFunc; - ObjCMsgSendFunc(String name, Type returnType, List params) + ObjCMsgSendFunc(String name, Type returnType, List params, + this.useVariants) : variant = ObjCMsgSendVariant.fromReturnType(returnType) { - func = Func( + normalFunc = Func( name: name, - originalName: variant.name, - returnType: isStret ? voidType : returnType, - parameters: [ - if (isStret) Parameter(name: 'stret', type: PointerType(returnType)), - Parameter(name: 'obj', type: PointerType(objCObjectType)), - Parameter(name: 'sel', type: PointerType(objCSelType)), - for (final p in params) Parameter(name: p.name, type: p.type), - ], + originalName: ObjCMsgSendVariant.normal.name, + returnType: returnType, + parameters: _params(params), isInternal: true, ); + switch (variant) { + case ObjCMsgSendVariant.normal: + variantFunc = null; + case ObjCMsgSendVariant.fpret: + variantFunc = Func( + name: '${name}_fpret', + originalName: variant.name, + returnType: returnType, + parameters: _params(params), + isInternal: true, + ); + case ObjCMsgSendVariant.stret: + variantFunc = Func( + name: '${name}_stret', + originalName: variant.name, + returnType: voidType, + parameters: _params(params, structRetPtr: PointerType(returnType)), + isInternal: true, + ); + } + } + + static List _params(List params, + {Type? structRetPtr}) { + return [ + if (structRetPtr != null) Parameter(name: 'stret', type: structRetPtr), + Parameter(name: 'obj', type: PointerType(objCObjectType)), + Parameter(name: 'sel', type: PointerType(objCSelType)), + for (final p in params) Parameter(name: p.name, type: p.type), + ]; } - String get name => func.name; bool get isStret => variant == ObjCMsgSendVariant.stret; void addDependencies(Set dependencies) { - func.addDependencies(dependencies); + if (variant != ObjCMsgSendVariant.normal) { + useVariants.addDependencies(dependencies); + } + normalFunc.addDependencies(dependencies); + variantFunc?.addDependencies(dependencies); + } + + String invoke(String lib, String target, String sel, Iterable params, + {String? structRetPtr}) { + final normalCall = _invoke(normalFunc.name, lib, target, sel, params); + switch (variant) { + case ObjCMsgSendVariant.normal: + return normalCall; + case ObjCMsgSendVariant.fpret: + final fpretCall = _invoke(variantFunc!.name, lib, target, sel, params); + return '$lib.${useVariants.name} ? $fpretCall : $normalCall'; + case ObjCMsgSendVariant.stret: + final stretCall = _invoke(variantFunc!.name, lib, target, sel, params, + structRetPtr: structRetPtr); + return '$lib.${useVariants.name} ? $stretCall : ' + '$structRetPtr.ref = $normalCall'; + } + } + + static String _invoke( + String name, + String lib, + String target, + String sel, + Iterable params, { + String? structRetPtr, + }) { + return '''$lib.$name(${[ + if (structRetPtr != null) structRetPtr, + target, + sel, + ...params, + ].join(', ')})'''; } } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 495cdf18b..5ec93d37c 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -109,9 +109,12 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { /// Returns whether [obj] is an instance of [$name]. static bool isInstance(_ObjCWrapper obj) { - return obj._lib.${_isKindOfClassMsgSend.name}( - obj._id, obj._lib.${_isKindOfClass.name}, - obj._lib.${_classObject.name}); + return ${_isKindOfClassMsgSend.invoke( + 'obj._lib', + 'obj._id', + 'obj._lib.${_isKindOfClass.name}', + ['obj._lib.${_classObject.name}'], + )}; } '''); @@ -200,18 +203,14 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} { if (returnType != voidType) { s.write(' ${convertReturn ? 'final _ret = ' : 'return '}'); } - s.write('_lib.${m.msgSend!.name}('); - if (isStret) { - s.write('stret, '); - } - s.write(isStatic ? '_lib.${_classObject.name}' : '_id'); - s.write(', _lib.${m.selObject!.name}'); - for (final p in m.params) { - final convertedParam = - p.type.convertDartTypeToFfiDartType(w, p.name, objCRetain: false); - s.write(', $convertedParam'); - } - s.write(');\n'); + s.write(m.msgSend!.invoke( + '_lib', + isStatic ? '_lib.${_classObject.name}' : '_id', + '_lib.${m.selObject!.name}', + m.params.map((p) => p.type + .convertDartTypeToFfiDartType(w, p.name, objCRetain: false)), + structRetPtr: 'stret')); + s.write(';\n'); if (convertReturn) { final result = returnType.convertFfiDartTypeToDartType( w,