Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/objective_c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ jobs:
run: flutter pub get
- name: Build the example app
run: flutter build macos
- name: Check for xcode for analyzer warnings
run: xcodebuild analyze -workspace macos/Runner.xcworkspace -scheme Runner -configuration Debug GCC_TREAT_WARNINGS_AS_ERRORS=YES
3 changes: 2 additions & 1 deletion pkgs/ffigen/lib/src/code_generator/objc_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ ref.pointer.ref.invoke.cast<${_helper.trampNatFnCType}>()
final blockingListenerRetains = [_waiterParam.name, ...retains];

final argStr = argsReceived.join(', ');
final declArgStr = argStr.isEmpty ? 'void' : argStr;
final blockingArgStr = [
_waiterParam.getNativeType(varName: _waiterParam.name),
...argsReceived,
Expand All @@ -416,7 +417,7 @@ ref.pointer.ref.invoke.cast<${_helper.trampNatFnCType}>()

return '''

typedef ${returnType.getNativeType()} (^$listenerName)($argStr);
typedef ${returnType.getNativeType()} (^$listenerName)($declArgStr);
__attribute__((visibility("default"))) __attribute__((used))
$listenerName $listenerWrapper($listenerName block) NS_RETURNS_RETAINED {
return ^void($argStr) {
Expand Down
6 changes: 3 additions & 3 deletions pkgs/objective_c/src/objective_c.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ FFI_EXPORT Version DOBJC_getOsVesion(void) {
NSOperatingSystemVersion objc_version =
[[NSProcessInfo processInfo] operatingSystemVersion];
Version c_version;
c_version.major = objc_version.majorVersion;
c_version.minor = objc_version.minorVersion;
c_version.patch = objc_version.patchVersion;
c_version.major = (int)objc_version.majorVersion;
c_version.minor = (int)objc_version.minorVersion;
c_version.patch = (int)objc_version.patchVersion;
return c_version;
}
2 changes: 1 addition & 1 deletion pkgs/objective_c/src/objective_c_bindings_generated.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ BOOL _ObjectiveCBindings_protocolTrampoline_w1e3k0(id target, void * sel, struc
return ((_ProtocolTrampoline_8)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1);
}

typedef void (^_ListenerTrampoline)();
typedef void (^_ListenerTrampoline)(void);
__attribute__((visibility("default"))) __attribute__((used))
_ListenerTrampoline _ObjectiveCBindings_wrapListenerBlock_1pl9qdv(_ListenerTrampoline block) NS_RETURNS_RETAINED {
return ^void() {
Expand Down