Comments (7)
Ah so AURenderEvent
is defined in an Objective-C header, even though it is just a C type. I'm guessing that's why the binding generator skips it.
Perhaps I could pull AURenderEvent
out into a separate header and add it here:
Line 50 in 5837e3a
from coreaudio-sys.
How about this?
from coreaudio-sys.
Did you just hand-write the header file instead of generating it because it's an ObjC header? I believe @simlay had made changes to bindgen to allow generating ObjC headers as well.
I remember that enabling it seems to change a few things in the generated code which if I remember right was not a big deal (but needed fixing). One problem was that by adding in ObjC generation, coreaudio-sys as a dependency takes wayyy longer to compile which doesn't seem ideal to have on by default.
Maybe there's a path forward where ObjC headers can be generated via an opt-in feature? I haven't used Rust since the work I did for adding iOS support, so perhaps with what I have mentioned above we can figure out a path forward? @simlay are you able to elaborate on the ObjC support?
I did some digging and found this https://rust-lang.github.io/rust-bindgen/objc.html and this https://github.com/simlay/uikit-sys/blob/master/build.rs#L55
I also found the thread where I mentioned disabling the ObjC support in some PR #33 (comment) So those would be the flags needed to re-enable it I think unless bindgen has changed a lot.
While adding your one header file manually would not make things any slower and would be faster than enabling ObjC support, it's my understanding that this goes against the point of the library which is to generate the headers?
from coreaudio-sys.
@MichaelHills I copy-pasted the code from the apple header. I didn't know bindgen had any ObjC support. In this case, I don't think it's too bad because Apple can't change AURenderEvent without breaking existing binaries. What do you think?
The library is still generating the bindings from headers.
from coreaudio-sys.
@MichaelHills I copy-pasted the code from the apple header. I didn't know bindgen had any ObjC support.
Yeah! I added a lot of the Objective-c support last year. I'll admit that it's definitely not perfect. It's missing rust-lang/rust-bindgen#1784.
In this case, I don't think it's too bad because Apple can't change AURenderEvent without breaking existing binaries. What do you think?
I mean, I think they can? I don't follow the SDK release notes well enough to know how often this happens.
from coreaudio-sys.
In this case, I don't think it's too bad
Personally I don't think it makes sense to manually cut/paste code from ObjC headers one file at a time as different people want them. The whole point of the library is to automatically (and completely?) generate bindings for different subsets of the coreaudio functionality. I think adding in ObjC support would be the better approach, but as @simlay pointed out whatever is currently in bindgen is not perfect.
I'll at least try re-activating the ObjC support and see what happens, and see if AURenderEvent comes out with it. Perhaps will also see if ObjC generation can be an opt-in flag if it's as slow as I remember it being. It's probably just slower because there's just so much more code to generate, but if I was using the library and it got 2x slower overnight with no way of turning it off I'd probably call that a performance regression.
from coreaudio-sys.
AURenderEvent does appear when objc support is enabled, see #55 but it's not quite working yet due to compile errors.
from coreaudio-sys.
Related Issues (20)
- Publish new version with framework path fix HOT 6
- [macOS 10.9] Build script `panic!`s with `'main' panicked at 'function not loaded: clang_Type_getNumTemplateArguments'` HOT 1
- macOS Version:10.13.5 (17F77) build error HOT 2
- Build error on OSX 10.11 HOT 1
- Upgrade to macOS Mojave 10.14 caused an installation error HOT 17
- Doesn't cross-compile from Linux HOT 6
- 10.14 parsing error in API_DEPRECATED macro HOT 1
- Build error on macOS 10.12 HOT 5
- Add support for iOS. HOT 1
- Using rustfmt 2.0 for the project? Bonus "stdin:" at beginning of generated coreaudio.rs
- Docs failed to build for 0.2.5. HOT 2
- macOS Big Sur 11.0.1 build failure HOT 9
- Build failure on Apple Sillicon HOT 2
- Build fails on a cross compiling toolchain from Linux HOT 3
- Build error on macOS 10.15 HOT 1
- Build error on Monterey HOT 2
- Build fails with v0.2.11 on crates.io after updating to Clang 16 HOT 3
- Nix and COREAUDIO_SDK_PATH fails to find AudioUnit/AudioUnit.h HOT 8
- Failed to compile on MacOS HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coreaudio-sys.