Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ffigen] Fix some C warnings #1835

Merged
merged 1 commit into from
Dec 30, 2024
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
4 changes: 2 additions & 2 deletions pkgs/ffigen/lib/src/code_generator/objc_protocol.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
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 @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions pkgs/objective_c/src/objective_c_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading