From 1748715993329c2b96fdb01d9b8baed774417d9e Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 29 Nov 2023 22:37:19 +1300 Subject: [PATCH 01/10] [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, From b5827f3b05d437a5bfc3d9675c6c35be2360476a Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 29 Nov 2023 18:23:21 +0100 Subject: [PATCH 02/10] [infra] Hide TODOs from problems view in VSCode (#837) Neat trick from https://dart-review.googlesource.com/c/sdk/+/338589. --- pkgs/ffigen/analysis_options.yaml | 2 ++ pkgs/jni/analysis_options.yaml | 2 ++ pkgs/jnigen/analysis_options.yaml | 2 ++ pkgs/native_assets_builder/analysis_options.yaml | 5 ++--- pkgs/native_assets_cli/analysis_options.yaml | 2 ++ pkgs/native_toolchain_c/analysis_options.yaml | 2 ++ 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml index 80574fd0f..0ba641e24 100644 --- a/pkgs/ffigen/analysis_options.yaml +++ b/pkgs/ffigen/analysis_options.yaml @@ -5,6 +5,8 @@ include: package:lints/recommended.yaml analyzer: + errors: + todo: ignore exclude: - 'test/**_expected*' # Goldens cannot be generated outside MacOS causing analysis errors. diff --git a/pkgs/jni/analysis_options.yaml b/pkgs/jni/analysis_options.yaml index 5c89b5804..9edc29244 100644 --- a/pkgs/jni/analysis_options.yaml +++ b/pkgs/jni/analysis_options.yaml @@ -1,6 +1,8 @@ include: package:flutter_lints/flutter.yaml analyzer: + errors: + todo: ignore exclude: [build/**, third_party/**] language: strict-raw-types: true diff --git a/pkgs/jnigen/analysis_options.yaml b/pkgs/jnigen/analysis_options.yaml index b32c3d098..54623dc10 100644 --- a/pkgs/jnigen/analysis_options.yaml +++ b/pkgs/jnigen/analysis_options.yaml @@ -5,6 +5,8 @@ include: package:lints/recommended.yaml analyzer: + errors: + todo: ignore exclude: [build/**, example/**] language: strict-raw-types: true diff --git a/pkgs/native_assets_builder/analysis_options.yaml b/pkgs/native_assets_builder/analysis_options.yaml index 756a4a80d..f1404fd46 100644 --- a/pkgs/native_assets_builder/analysis_options.yaml +++ b/pkgs/native_assets_builder/analysis_options.yaml @@ -1,11 +1,10 @@ include: package:dart_flutter_team_lints/analysis_options.yaml analyzer: + errors: + todo: ignore language: strict-raw-types: true - exclude: - # TODO(https://github.com/dart-lang/ecosystem/issues/150): Remove this. - - test/data/ linter: rules: diff --git a/pkgs/native_assets_cli/analysis_options.yaml b/pkgs/native_assets_cli/analysis_options.yaml index f69a8643a..f1404fd46 100644 --- a/pkgs/native_assets_cli/analysis_options.yaml +++ b/pkgs/native_assets_cli/analysis_options.yaml @@ -1,6 +1,8 @@ include: package:dart_flutter_team_lints/analysis_options.yaml analyzer: + errors: + todo: ignore language: strict-raw-types: true diff --git a/pkgs/native_toolchain_c/analysis_options.yaml b/pkgs/native_toolchain_c/analysis_options.yaml index f69a8643a..f1404fd46 100644 --- a/pkgs/native_toolchain_c/analysis_options.yaml +++ b/pkgs/native_toolchain_c/analysis_options.yaml @@ -1,6 +1,8 @@ include: package:dart_flutter_team_lints/analysis_options.yaml analyzer: + errors: + todo: ignore language: strict-raw-types: true From de66c937494e8ced24aab1672762162a26cb3021 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 05:19:00 +0000 Subject: [PATCH 03/10] Bump nttld/setup-ndk from 1.4.1 to 1.4.2 (#841) Bumps [nttld/setup-ndk](https://github.com/nttld/setup-ndk) from 1.4.1 to 1.4.2.
Release notes

Sourced from nttld/setup-ndk's releases.

setup-ndk 1.4.2

  • Overwrite existing install when using link-to-sdk
Commits
  • 6a7e9c5 1.4.2
  • e25540e Merge pull request #519 from nttld/overwrite
  • e6d76e0 overwrite existing ndks
  • aabd401 Merge pull request #517 from nttld/dependabot/npm_and_yarn/dev-dependencies-9...
  • 492aab9 Bump the dev-dependencies group with 3 updates
  • b840b44 Merge pull request #516 from nttld/dependabot/npm_and_yarn/dev-dependencies-4...
  • 5d96d95 Bump the dev-dependencies group with 4 updates
  • 4ccdc12 Merge pull request #515 from nttld/dependabot/npm_and_yarn/dev-dependencies-b...
  • 664b0ec Bump the dev-dependencies group with 3 updates
  • 3fc7270 Merge pull request #514 from lomirus/main
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nttld/setup-ndk&package-manager=github_actions&previous-version=1.4.1&new-version=1.4.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/native.yaml | 2 +- .github/workflows/native_toolchain_c.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml index c954eba6b..61ffdc247 100644 --- a/.github/workflows/native.yaml +++ b/.github/workflows/native.yaml @@ -58,7 +58,7 @@ jobs: with: sdk: ${{ matrix.sdk }} - - uses: nttld/setup-ndk@3354316c3285ea90da09d047280dd79d00d5a37a + - uses: nttld/setup-ndk@6a7e9c5494a25c4842ca1011f710300132eacd94 with: ndk-version: r26b if: ${{ matrix.sdk == 'stable' }} diff --git a/.github/workflows/native_toolchain_c.yaml b/.github/workflows/native_toolchain_c.yaml index ceb668b5f..e867067b0 100644 --- a/.github/workflows/native_toolchain_c.yaml +++ b/.github/workflows/native_toolchain_c.yaml @@ -38,7 +38,7 @@ jobs: with: sdk: ${{ matrix.sdk }} - - uses: nttld/setup-ndk@3354316c3285ea90da09d047280dd79d00d5a37a + - uses: nttld/setup-ndk@6a7e9c5494a25c4842ca1011f710300132eacd94 with: ndk-version: r26b if: ${{ matrix.sdk == 'stable' }} From 07abdd6fde1e39fed22138f246862ba524918cc8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 05:24:37 +0000 Subject: [PATCH 04/10] Bump actions/setup-java from 3.13.0 to 4.0.0 (#842) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3.13.0 to 4.0.0.
Release notes

Sourced from actions/setup-java's releases.

v4.0.0

What's Changed

In the scope of this release, the version of the Node.js runtime was updated to 20. The majority of dependencies were updated to the latest versions. From now on, the code for the setup-java will run on Node.js 20 instead of Node.js 16.

Breaking changes

Non-breaking changes

New Contributors

Full Changelog: https://github.com/actions/setup-java/compare/v3...v4.0.0

Commits
  • 387ac29 Upgrade Node to v20 (#558)
  • 9eda6b5 feat: implement cache-dependency-path option to control caching dependency (#...
  • 78078da Update @​actions/cache dependency and documentation (#549)
  • 5caaba6 add support for microsoft openjdk 21.0.0 (#546)
  • See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-java&package-manager=github_actions&previous-version=3.13.0&new-version=4.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- .github/workflows/jnigen.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/jnigen.yaml b/.github/workflows/jnigen.yaml index cbb9e88dc..cf486c762 100644 --- a/.github/workflows/jnigen.yaml +++ b/.github/workflows/jnigen.yaml @@ -81,7 +81,7 @@ jobs: channel: ${{ matrix.sdk }} cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'zulu' java-version: '11' @@ -134,7 +134,7 @@ jobs: channel: 'stable' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'zulu' java-version: '11' @@ -172,7 +172,7 @@ jobs: channel: 'stable' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'zulu' java-version: '11' @@ -221,7 +221,7 @@ jobs: channel: 'stable' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'zulu' java-version: '11' @@ -248,7 +248,7 @@ jobs: channel: 'stable' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'zulu' java-version: '11' @@ -276,7 +276,7 @@ jobs: channel: 'stable' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'temurin' java-version: '11' @@ -301,7 +301,7 @@ jobs: channel: 'stable' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'temurin' java-version: '11' @@ -326,7 +326,7 @@ jobs: channel: 'stable' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'zulu' java-version: '11' @@ -350,7 +350,7 @@ jobs: channel: 'stable' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'zulu' java-version: '11' @@ -365,7 +365,7 @@ jobs: working-directory: ./pkgs/jni/example steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'zulu' java-version: '11' @@ -389,7 +389,7 @@ jobs: channel: 'stable' cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: distribution: 'zulu' java-version: '11' From ec9e2b2ddca2ed6c652d6b522a45eb1f618890cd Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Fri, 1 Dec 2023 16:01:24 +0100 Subject: [PATCH 05/10] [native_assets_builder] Don't use FFIgen in test (#843) The Windows bots on the Dart SDK CI don't have libclang installed: https://dart-review.googlesource.com/c/sdk/+/339124 -> https://dart-ci.firebaseapp.com/cl/339124/5 -> https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8762986001033204401/+/u/test_results/new_test_failures__logs_ This test does not need to use FFIgen, we can use some other package with a bin script. --- .../test/build_runner/build_runner_asset_id_test.dart | 3 +++ .../build_runner/build_runner_non_root_package_test.dart | 2 +- pkgs/native_assets_builder/test/data/manifest.yaml | 2 ++ .../test/data/native_add/pubspec.yaml | 2 ++ .../test/data/some_dev_dep/bin/some_dev_dep.dart | 7 +++++++ .../test/data/some_dev_dep/pubspec.yaml | 8 ++++++++ 6 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 pkgs/native_assets_builder/test/data/some_dev_dep/bin/some_dev_dep.dart create mode 100644 pkgs/native_assets_builder/test/data/some_dev_dep/pubspec.yaml diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart index 19ad31922..18805b9af 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart @@ -44,6 +44,9 @@ void main() async { test('right asset id but other directory', timeout: longTimeout, () async { await inTempDir((tempUri) async { final packageUri = tempUri.resolve('different_root_dir/'); + await copyTestProjects( + targetUri: tempUri, + ); await copyTestProjects( sourceUri: testDataUri.resolve('native_add/'), targetUri: packageUri, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart index 80f6c8d37..f1050f741 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart @@ -29,7 +29,7 @@ void main() async { logger, dartExecutable, capturedLogs: logMessages, - runPackageName: 'ffigen', + runPackageName: 'some_dev_dep', ); expect(result.assets, isEmpty); expect(result.dependencies, isEmpty); diff --git a/pkgs/native_assets_builder/test/data/manifest.yaml b/pkgs/native_assets_builder/test/data/manifest.yaml index c52f500bd..04649be33 100644 --- a/pkgs/native_assets_builder/test/data/manifest.yaml +++ b/pkgs/native_assets_builder/test/data/manifest.yaml @@ -27,6 +27,8 @@ - package_reading_metadata/pubspec.yaml - package_with_metadata/build.dart - package_with_metadata/pubspec.yaml +- some_dev_dep/bin/some_dev_dep.dart +- some_dev_dep/pubspec.yaml - wrong_build_output/build.dart - wrong_build_output/pubspec.yaml - wrong_build_output_2/build.dart diff --git a/pkgs/native_assets_builder/test/data/native_add/pubspec.yaml b/pkgs/native_assets_builder/test/data/native_add/pubspec.yaml index cfdae1aef..0303d6006 100644 --- a/pkgs/native_assets_builder/test/data/native_add/pubspec.yaml +++ b/pkgs/native_assets_builder/test/data/native_add/pubspec.yaml @@ -16,4 +16,6 @@ dependencies: dev_dependencies: ffigen: ^8.0.2 lints: ^3.0.0 + some_dev_dep: + path: ../some_dev_dep/ test: ^1.23.1 diff --git a/pkgs/native_assets_builder/test/data/some_dev_dep/bin/some_dev_dep.dart b/pkgs/native_assets_builder/test/data/some_dev_dep/bin/some_dev_dep.dart new file mode 100644 index 000000000..e5189cb49 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/some_dev_dep/bin/some_dev_dep.dart @@ -0,0 +1,7 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +void main() { + print('Hello world!'); +} diff --git a/pkgs/native_assets_builder/test/data/some_dev_dep/pubspec.yaml b/pkgs/native_assets_builder/test/data/some_dev_dep/pubspec.yaml new file mode 100644 index 000000000..4d22d95cd --- /dev/null +++ b/pkgs/native_assets_builder/test/data/some_dev_dep/pubspec.yaml @@ -0,0 +1,8 @@ +name: some_dev_dep +description: Has a bin script that can be run from the context of other root packages. +version: 0.1.0 + +publish_to: none + +environment: + sdk: '>=3.0.0 <4.0.0' From 5aeab2915167fd24ccb1241c07516b388fda2b9b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Fri, 1 Dec 2023 18:04:34 +0100 Subject: [PATCH 06/10] [native_assets_builder] Handle non-existing package names (#844) With `dart/flutter run dont_exist`, dartdev or flutter_tools might pass a package name to `runPackageName` that is not in the package graph. --- .../lib/src/build_runner/build_planner.dart | 5 ++ .../test/build_runner/build_planner_test.dart | 47 ++++++++++--------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_planner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_planner.dart index 81d050ddb..492f8a533 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_planner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_planner.dart @@ -115,6 +115,11 @@ class PackageGraph { graphs.stronglyConnectedComponents(vertices, neighborsOf); PackageGraph subGraph(String rootPackageName) { + if (!vertices.contains(rootPackageName)) { + // Some downstream tooling requested a package that doesn't exist. + // This will likely lead to an error, so avoid building native assets. + return PackageGraph({}); + } final subgraphVertices = [ ...graphs.transitiveClosure(vertices, neighborsOf)[rootPackageName]!, rootPackageName, diff --git a/pkgs/native_assets_builder/test/build_runner/build_planner_test.dart b/pkgs/native_assets_builder/test/build_runner/build_planner_test.dart index 37af2a37d..9669c17da 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_planner_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_planner_test.dart @@ -76,29 +76,32 @@ void main() async { }); }); - test('runPackageName', () async { - await inTempDir((tempUri) async { - await copyTestProjects(targetUri: tempUri); - final nativeAddUri = tempUri.resolve('native_add/'); + for (final existing in [true, false]) { + final runPackageName = existing ? 'ffigen' : 'does_not_exist'; + test('runPackageName $runPackageName', () async { + await inTempDir((tempUri) async { + await copyTestProjects(targetUri: tempUri); + final nativeAddUri = tempUri.resolve('native_add/'); - // First, run `pub get`, we need pub to resolve our dependencies. - await runPubGet(workingDirectory: nativeAddUri, logger: logger); + // First, run `pub get`, we need pub to resolve our dependencies. + await runPubGet(workingDirectory: nativeAddUri, logger: logger); - final packageLayout = - await PackageLayout.fromRootPackageRoot(nativeAddUri); - final packagesWithNativeAssets = - await packageLayout.packagesWithNativeAssets; - final nativeAssetsBuildPlanner = - await NativeAssetsBuildPlanner.fromRootPackageRoot( - rootPackageRoot: nativeAddUri, - packagesWithNativeAssets: packagesWithNativeAssets, - dartExecutable: Uri.file(Platform.resolvedExecutable), - logger: logger, - ); - final (buildPlan, _) = nativeAssetsBuildPlanner.plan( - runPackageName: 'ffigen', - ); - expect(buildPlan.length, 0); + final packageLayout = + await PackageLayout.fromRootPackageRoot(nativeAddUri); + final packagesWithNativeAssets = + await packageLayout.packagesWithNativeAssets; + final nativeAssetsBuildPlanner = + await NativeAssetsBuildPlanner.fromRootPackageRoot( + rootPackageRoot: nativeAddUri, + packagesWithNativeAssets: packagesWithNativeAssets, + dartExecutable: Uri.file(Platform.resolvedExecutable), + logger: logger, + ); + final (buildPlan, _) = nativeAssetsBuildPlanner.plan( + runPackageName: runPackageName, + ); + expect(buildPlan.length, 0); + }); }); - }); + } } From 4282d81367499e726ce1c9530dad6adebae5095d Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 5 Dec 2023 16:01:24 +0100 Subject: [PATCH 07/10] [native_assets_builder] Remove autopublishing workaround (#850) See https://github.com/dart-lang/pub/issues/3982#issuecomment-1839788919. --- pkgs/native_assets_builder/.pubignore | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 pkgs/native_assets_builder/.pubignore diff --git a/pkgs/native_assets_builder/.pubignore b/pkgs/native_assets_builder/.pubignore deleted file mode 100644 index 1d80e790e..000000000 --- a/pkgs/native_assets_builder/.pubignore +++ /dev/null @@ -1,14 +0,0 @@ -# Please keep consistent with .gitignore. - -# https://dart.dev/guides/libraries/private-files -# Created by `dart pub` -.dart_tool/ - -# Avoid committing pubspec.lock for library packages; see -# https://dart.dev/guides/libraries/private-files#pubspeclock. -pubspec.lock - -coverage/ - -# Woraround https://github.com/dart-lang/pub/issues/3982 -test/ From a0949f55a0637b1f35094b51e3cad9a5acac5b9d Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 5 Dec 2023 17:54:50 +0100 Subject: [PATCH 08/10] Workflow cleanups (#846) * Add pubspec overrides * Remove tool to change deps * Fix override * Add health workflow * Do not test breaking changes * Remove health workflow * Switch to dart script * Fix path * Add newlines * Fixes --- .github/workflows/native.yaml | 7 +-- .../pubspec_overrides.yaml | 3 ++ .../cyclic_package_1/pubspec_overrides.yaml | 3 ++ .../cyclic_package_2/pubspec_overrides.yaml | 3 ++ .../test/data/manifest.yaml | 10 ++++ .../test/data/native_add/manifest.yaml | 1 + .../data/native_add/pubspec_overrides.yaml | 5 ++ .../pubspec_overrides.yaml | 5 ++ .../native_subtract/pubspec_overrides.yaml | 5 ++ .../pubspec_overrides.yaml | 3 ++ .../pubspec_overrides.yaml | 3 ++ .../wrong_build_output/pubspec_overrides.yaml | 3 ++ .../pubspec_overrides.yaml | 3 ++ .../pubspec_overrides.yaml | 3 ++ .../pubspec_overrides.yaml | 3 ++ pkgs/native_assets_builder/test/helpers.dart | 13 +++-- .../native_add_library/pubspec_overrides.yaml | 5 ++ .../native_toolchain_c/pubspec_overrides.yaml | 3 ++ tools/.gitignore | 9 ---- tools/bin/change_dependencies.dart | 52 ------------------- tools/delete_pubspec_overrides.dart | 6 +++ tools/pubspec.yaml | 14 ----- 22 files changed, 78 insertions(+), 84 deletions(-) create mode 100644 pkgs/native_assets_builder/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/cyclic_package_1/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/cyclic_package_2/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/native_add/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/native_add_add_source/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/native_subtract/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/package_reading_metadata/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/package_with_metadata/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/wrong_build_output/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/wrong_build_output_2/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/wrong_build_output_3/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_builder/test/data/wrong_namespace_asset/pubspec_overrides.yaml create mode 100644 pkgs/native_assets_cli/example/native_add_library/pubspec_overrides.yaml create mode 100644 pkgs/native_toolchain_c/pubspec_overrides.yaml delete mode 100644 tools/.gitignore delete mode 100644 tools/bin/change_dependencies.dart create mode 100644 tools/delete_pubspec_overrides.dart delete mode 100644 tools/pubspec.yaml diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml index 61ffdc247..3b6f0d613 100644 --- a/.github/workflows/native.yaml +++ b/.github/workflows/native.yaml @@ -63,11 +63,8 @@ jobs: ndk-version: r26b if: ${{ matrix.sdk == 'stable' }} - - run: dart pub get -C ../../tools/ - if: ${{ matrix.dependencies == 'path' }} - - - run: dart ../../tools/bin/change_dependencies.dart - if: ${{ matrix.dependencies == 'path' }} + - run: dart run ../../tools/delete_pubspec_overrides.dart + if: ${{ matrix.dependencies == 'published' }} - run: dart pub get diff --git a/pkgs/native_assets_builder/pubspec_overrides.yaml b/pkgs/native_assets_builder/pubspec_overrides.yaml new file mode 100644 index 000000000..0c523c6f3 --- /dev/null +++ b/pkgs/native_assets_builder/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test/data/cyclic_package_1/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/cyclic_package_1/pubspec_overrides.yaml new file mode 100644 index 000000000..c18eed080 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/cyclic_package_1/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test/data/cyclic_package_2/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/cyclic_package_2/pubspec_overrides.yaml new file mode 100644 index 000000000..c18eed080 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/cyclic_package_2/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test/data/manifest.yaml b/pkgs/native_assets_builder/test/data/manifest.yaml index 04649be33..7ae8b9e14 100644 --- a/pkgs/native_assets_builder/test/data/manifest.yaml +++ b/pkgs/native_assets_builder/test/data/manifest.yaml @@ -2,8 +2,10 @@ # a completely clean setup. - cyclic_package_1/build.dart - cyclic_package_1/pubspec.yaml +- cyclic_package_1/pubspec_overrides.yaml - cyclic_package_2/build.dart - cyclic_package_2/pubspec.yaml +- cyclic_package_2/pubspec_overrides.yaml - dart_app/bin/dart_app.dart - dart_app/pubspec.yaml - native_add/build.dart @@ -12,6 +14,7 @@ - native_add/lib/src/native_add_bindings_generated.dart - native_add/lib/src/native_add.dart - native_add/pubspec.yaml +- native_add/pubspec_overrides.yaml - native_add/src/native_add.c - native_add/src/native_add.h - native_add/test/native_add_test.dart @@ -21,19 +24,26 @@ - native_subtract/lib/src/native_subtract_bindings_generated.dart - native_subtract/lib/src/native_subtract.dart - native_subtract/pubspec.yaml +- native_subtract/pubspec_overrides.yaml - native_subtract/src/native_subtract.c - native_subtract/src/native_subtract.h - package_reading_metadata/build.dart - package_reading_metadata/pubspec.yaml +- package_reading_metadata/pubspec_overrides.yaml - package_with_metadata/build.dart - package_with_metadata/pubspec.yaml +- package_with_metadata/pubspec_overrides.yaml - some_dev_dep/bin/some_dev_dep.dart - some_dev_dep/pubspec.yaml - wrong_build_output/build.dart - wrong_build_output/pubspec.yaml +- wrong_build_output/pubspec_overrides.yaml - wrong_build_output_2/build.dart - wrong_build_output_2/pubspec.yaml +- wrong_build_output_2/pubspec_overrides.yaml - wrong_build_output_3/build.dart - wrong_build_output_3/pubspec.yaml +- wrong_build_output_3/pubspec_overrides.yaml - wrong_namespace_asset/build.dart - wrong_namespace_asset/pubspec.yaml +- wrong_namespace_asset/pubspec_overrides.yaml diff --git a/pkgs/native_assets_builder/test/data/native_add/manifest.yaml b/pkgs/native_assets_builder/test/data/native_add/manifest.yaml index e922db8c1..8360a6bd6 100644 --- a/pkgs/native_assets_builder/test/data/native_add/manifest.yaml +++ b/pkgs/native_assets_builder/test/data/native_add/manifest.yaml @@ -4,6 +4,7 @@ - lib/src/native_add_bindings_generated.dart - lib/src/native_add.dart - pubspec.yaml +- pubspec_overrides.yaml - src/native_add.c - src/native_add.h - test/native_add_test.dart diff --git a/pkgs/native_assets_builder/test/data/native_add/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/native_add/pubspec_overrides.yaml new file mode 100644 index 000000000..8e850de76 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/native_add/pubspec_overrides.yaml @@ -0,0 +1,5 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ + native_toolchain_c: + path: ../../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test/data/native_add_add_source/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/native_add_add_source/pubspec_overrides.yaml new file mode 100644 index 000000000..8e850de76 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/native_add_add_source/pubspec_overrides.yaml @@ -0,0 +1,5 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ + native_toolchain_c: + path: ../../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test/data/native_subtract/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/native_subtract/pubspec_overrides.yaml new file mode 100644 index 000000000..8e850de76 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/native_subtract/pubspec_overrides.yaml @@ -0,0 +1,5 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ + native_toolchain_c: + path: ../../../../native_toolchain_c/ diff --git a/pkgs/native_assets_builder/test/data/package_reading_metadata/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/package_reading_metadata/pubspec_overrides.yaml new file mode 100644 index 000000000..c18eed080 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/package_reading_metadata/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test/data/package_with_metadata/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/package_with_metadata/pubspec_overrides.yaml new file mode 100644 index 000000000..c18eed080 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/package_with_metadata/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test/data/wrong_build_output/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/wrong_build_output/pubspec_overrides.yaml new file mode 100644 index 000000000..c18eed080 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/wrong_build_output/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test/data/wrong_build_output_2/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/wrong_build_output_2/pubspec_overrides.yaml new file mode 100644 index 000000000..c18eed080 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/wrong_build_output_2/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test/data/wrong_build_output_3/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/wrong_build_output_3/pubspec_overrides.yaml new file mode 100644 index 000000000..c18eed080 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/wrong_build_output_3/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test/data/wrong_namespace_asset/pubspec_overrides.yaml b/pkgs/native_assets_builder/test/data/wrong_namespace_asset/pubspec_overrides.yaml new file mode 100644 index 000000000..c18eed080 --- /dev/null +++ b/pkgs/native_assets_builder/test/data/wrong_namespace_asset/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../../../../native_assets_cli/ diff --git a/pkgs/native_assets_builder/test/helpers.dart b/pkgs/native_assets_builder/test/helpers.dart index 522aa97f9..56d310b24 100644 --- a/pkgs/native_assets_builder/test/helpers.dart +++ b/pkgs/native_assets_builder/test/helpers.dart @@ -123,10 +123,15 @@ Future copyTestProjects({ for (final path in manifestYaml.contents as YamlList) Uri(path: path as String) ]; - final filesToCopy = - manifest.where((e) => e.pathSegments.last != 'pubspec.yaml').toList(); - final filesToModify = - manifest.where((e) => e.pathSegments.last == 'pubspec.yaml').toList(); + final filesToCopy = manifest + .where((e) => !(e.pathSegments.last.startsWith('pubspec') && + e.pathSegments.last.endsWith('.yaml'))) + .toList(); + final filesToModify = manifest + .where((e) => + e.pathSegments.last.startsWith('pubspec') && + e.pathSegments.last.endsWith('.yaml')) + .toList(); for (final pathToCopy in filesToCopy) { final sourceFile = File.fromUri(sourceUri.resolveUri(pathToCopy)); diff --git a/pkgs/native_assets_cli/example/native_add_library/pubspec_overrides.yaml b/pkgs/native_assets_cli/example/native_add_library/pubspec_overrides.yaml new file mode 100644 index 000000000..272d61ecc --- /dev/null +++ b/pkgs/native_assets_cli/example/native_add_library/pubspec_overrides.yaml @@ -0,0 +1,5 @@ +dependency_overrides: + native_assets_cli: + path: ../../../native_assets_cli/ + native_toolchain_c: + path: ../../../native_toolchain_c/ diff --git a/pkgs/native_toolchain_c/pubspec_overrides.yaml b/pkgs/native_toolchain_c/pubspec_overrides.yaml new file mode 100644 index 000000000..0c523c6f3 --- /dev/null +++ b/pkgs/native_toolchain_c/pubspec_overrides.yaml @@ -0,0 +1,3 @@ +dependency_overrides: + native_assets_cli: + path: ../native_assets_cli/ diff --git a/tools/.gitignore b/tools/.gitignore deleted file mode 100644 index 0b3e7bc22..000000000 --- a/tools/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Please keep consistent with .pubignore. - -# https://dart.dev/guides/libraries/private-files -# Created by `dart pub` -.dart_tool/ - -# Avoid committing pubspec.lock for library packages; see -# https://dart.dev/guides/libraries/private-files#pubspeclock. -pubspec.lock diff --git a/tools/bin/change_dependencies.dart b/tools/bin/change_dependencies.dart deleted file mode 100644 index dd7b93ee4..000000000 --- a/tools/bin/change_dependencies.dart +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:io'; - -import 'package:glob/glob.dart'; -import 'package:glob/list_local_fs.dart'; -import 'package:yaml_edit/yaml_edit.dart'; -import 'package:yaml/yaml.dart'; - -void main(List args) { - final root = Platform.script.resolve('../../'); - final glob = Glob('**pubspec.yaml'); - final files = glob.listSync(root: root.toFilePath()).whereType(); - for (final file in files) { - final yamlEditor = YamlEditor(file.readAsStringSync()); - final yaml = yamlEditor.parseAt([]); - if (yaml is! YamlMap) { - continue; - } - final dependencies = yaml['dependencies']; - if (dependencies is! YamlMap) { - continue; - } - for (final package in dependencies.keys) { - if (!packagesToPin.contains(package)) { - continue; - } - yamlEditor.update( - ['dependencies', package], - { - // Some packages contain full test projects that are copied in unit - // tests. So, use absolute paths. - 'path': - root.resolve('pkgs/$package/').toFilePath().replaceAll(r'\', '/'), - }, - ); - } - if (yamlEditor.edits.isEmpty) { - continue; - } - yamlEditor.update(['publish_to'], 'none'); - file.writeAsStringSync(yamlEditor.toString()); - } -} - -const packagesToPin = { - 'native_assets_builder', - 'native_assets_cli', - 'native_toolchain_c', -}; diff --git a/tools/delete_pubspec_overrides.dart b/tools/delete_pubspec_overrides.dart new file mode 100644 index 000000000..5ae2ff795 --- /dev/null +++ b/tools/delete_pubspec_overrides.dart @@ -0,0 +1,6 @@ +import 'dart:io'; + +void main(List arguments) => Directory.current + .list(recursive: true) + .where((f) => f.path.endsWith('pubspec_overrides.yaml')) + .forEach((f) => f.deleteSync()); diff --git a/tools/pubspec.yaml b/tools/pubspec.yaml deleted file mode 100644 index 396d15afe..000000000 --- a/tools/pubspec.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: tools_for_dart_lang_native -description: >- - Some helper scripts for https://github.com/dart-lang/native. -version: 0.1.0 -repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_builder - -publish_to: none - -environment: - sdk: '>=3.0.0 <4.0.0' - -dependencies: - glob: ^2.1.2 - yaml_edit: ^2.1.1 From adbe7798bf8fa81cb536d9bf1683b777a2c74347 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 5 Dec 2023 14:07:15 -0800 Subject: [PATCH 09/10] [ffigen] Run ffigen CI less often on Apple silicon (#847) * Run ffigen CI less often on Apple silicon * Daco's comments --- .github/workflows/ffigen.yml | 11 ++-------- .github/workflows/ffigen_weekly.yml | 31 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/ffigen_weekly.yml diff --git a/.github/workflows/ffigen.yml b/.github/workflows/ffigen.yml index 996e2c79c..945cca21c 100644 --- a/.github/workflows/ffigen.yml +++ b/.github/workflows/ffigen.yml @@ -66,14 +66,10 @@ jobs: - name: Run VM tests run: dart test --platform vm --concurrency=1 + # Keep in sync with ffigen_weekly.yaml:test-mac-arm64 test-mac: needs: analyze - strategy: - matrix: - host: - - 'macos-latest' - - 'macos-latest-xlarge' # Arm64. - runs-on: ${{ matrix.host }} + runs-on: 'macos-latest' defaults: run: working-directory: pkgs/ffigen/ @@ -90,7 +86,6 @@ jobs: run: dart test --platform vm --concurrency=1 - name: Collect coverage run: ./tool/coverage.sh - if: ${{ matrix.host == 'macos-latest' }} - name: Upload coverage uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 with: @@ -98,14 +93,12 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} parallel: true path-to-lcov: pkgs/ffigen/lcov.info - if: ${{ matrix.host == 'macos-latest' }} - name: Upload coverage uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 with: carryforward: "jnigen_tests,jni_tests,native_assets_builder_macos,native_assets_builder_ubuntu,native_assets_builder_windows,native_assets_cli_macos,native_assets_cli_ubuntu,native_assets_cli_windows,native_toolchain_c_macos,native_toolchain_c_ubuntu,native_toolchain_c_windows" github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true - if: ${{ matrix.host == 'macos-latest' }} test-windows: needs: analyze diff --git a/.github/workflows/ffigen_weekly.yml b/.github/workflows/ffigen_weekly.yml new file mode 100644 index 000000000..4d8d1060a --- /dev/null +++ b/.github/workflows/ffigen_weekly.yml @@ -0,0 +1,31 @@ +# Run the ffigen tests on apple silicon once a week. Unlike the other GitHub +# CI hosts, this one isn't free, so we don't run it on every commit. + +name: ffigen_weekly + +on: + # Run once a week. + schedule: + - cron: "0 0 * * 0" + +env: + PUB_ENVIRONMENT: bot.github + +jobs: + # Keep in sync with ffigen.yaml:test-mac + test-mac-arm64: + runs-on: 'macos-latest-xlarge' # Arm64. + defaults: + run: + working-directory: pkgs/ffigen/ + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d + with: + sdk: 3.2.0 + - name: Install dependencies + run: dart pub get + - name: Build test dylib and bindings + run: dart test/setup.dart + - name: Run VM tests + run: dart test --platform vm --concurrency=1 From b668ca94f551fcebdeb3ce9f822170facced55ae Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 6 Dec 2023 09:23:05 +0100 Subject: [PATCH 10/10] Add `health.yaml` workflow (#851) * Add `health.yaml` workflow * Nits * Remove whitespace * Update args --- .github/workflows/health.yaml | 14 ++++++++++++++ .github/workflows/post_summaries.yaml | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/health.yaml diff --git a/.github/workflows/health.yaml b/.github/workflows/health.yaml new file mode 100644 index 000000000..21b4ddb15 --- /dev/null +++ b/.github/workflows/health.yaml @@ -0,0 +1,14 @@ +name: Health +on: + pull_request: + branches: [ main ] + types: [opened, synchronize, reopened, labeled, unlabeled] +jobs: + health: + uses: dart-lang/ecosystem/.github/workflows/health.yaml@main + with: + coverage_web: true + checks: "version,changelog,license,coverage,do-not-submit,breaking" + use-flutter: true + permissions: + pull-requests: write diff --git a/.github/workflows/post_summaries.yaml b/.github/workflows/post_summaries.yaml index a47509258..8697d74a5 100644 --- a/.github/workflows/post_summaries.yaml +++ b/.github/workflows/post_summaries.yaml @@ -4,7 +4,8 @@ on: # Trigger this workflow after the Health workflow completes. This workflow will have permissions to # do things like create comments on the PR, even if the original workflow couldn't. workflow_run: - workflows: + workflows: + - Health - Publish types: - completed