dart-lang / dart-lang/native

[ObjectiveC] Invalid bindings generated for AVFAudio framework

Open
#454 0 comments 0 reactions 0 assignees View on GitHub
lang-objective_c package:ffigen
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

# Context

I was playing around with the objective_c example and using a glob for the entrypoint: `AVFAudio.framework/**.h` instead of `AVFAudio.framework/Headers/AVAudioPlayer.h`. I noticed a few issues with the generated bindings.

# Issues

There are 2 issues that I noticed with the bindings (#578 and dart-lang/native#452), and 1 more general issue with some of the interfaces being included:

## Objective C interfaces are included, even if not referenced from an included interface with `exclude-all-by-default: true`

I'm not sure why the `AVAudioNode` is included, except perhaps that there's a section in `AVAudioPlayer.h`:
```c++
#if __has_include()
#import
#endif
```
And, since I am using a glob pattern for the entry points, `AVAudioSession.h` was included and **it** indirectly references `AVAudioNode`. I think the way we're filtering out declarations may need to be more granular. This also could reduce the size of generated bindings, in general.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.