diff --git a/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart b/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart index cca7da841..0c0eeb882 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart @@ -164,10 +164,10 @@ ${makeDartDoc(dartDoc ?? originalName)}abstract final class $name { @override BindingString? toObjCBindingString(Writer w) { - final wrapperName = builtInFunctions.wrapperName; + final wrapName = builtInFunctions.wrapperName; final mainString = ''' -Protocol* _${wrapperName}_$originalName() { return @protocol($originalName); } +Protocol* _${wrapName}_$originalName(void) { return @protocol($originalName); } '''; return BindingString( diff --git a/pkgs/objective_c/src/objective_c_bindings_generated.m b/pkgs/objective_c/src/objective_c_bindings_generated.m index 80ce85af1..df52bfe84 100644 --- a/pkgs/objective_c/src/objective_c_bindings_generated.m +++ b/pkgs/objective_c/src/objective_c_bindings_generated.m @@ -10,7 +10,7 @@ id objc_retain(id); id objc_retainBlock(id); -Protocol* _ObjectiveCBindings_NSStreamDelegate() { return @protocol(NSStreamDelegate); } +Protocol* _ObjectiveCBindings_NSStreamDelegate(void) { return @protocol(NSStreamDelegate); } typedef void (^_ListenerTrampoline)(id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) diff --git a/pkgs/objective_c/src/objective_c_runtime.h b/pkgs/objective_c/src/objective_c_runtime.h index 3849ccd55..f911c549f 100644 --- a/pkgs/objective_c/src/objective_c_runtime.h +++ b/pkgs/objective_c/src/objective_c_runtime.h @@ -27,9 +27,9 @@ ObjCObject** objc_copyClassList(unsigned int* count); // The signature of this function is just a placeholder. This function is used // by every method invocation, and is cast to every signature we need. -void objc_msgSend(); -void objc_msgSend_fpret(); -void objc_msgSend_stret(); +void objc_msgSend(void); +void objc_msgSend_fpret(void); +void objc_msgSend_stret(void); // See https://clang.llvm.org/docs/Block-ABI-Apple.html typedef struct _ObjCBlockDesc {