3 ms·
How is that not simple? You just declare the function and then call it. I find it hard to imagine how it could be any more simple than that.
by kelnos 2y ago
How is that not simple? You just declare the function and then call it. I find it hard to imagine how it could be any more simple than that.
- varjag 2y agoNow imagine a hundred or two functions, structures and callbacks, some of them exposed only as CPP macros over internal implementation. PJSIP low level API is one example.
- lambda 2y agoBut... that's what bindgen is for. Which I mentioned. I said it "can be quite simple"; for simple use cases, just using extern and translating the declarations by hand is perfectly viable. For more complex cases, you use bindgen.
- varjag 2y agoBindings generators exist in most other languages with same limitations. I would love to see how bindgen would handle a function call defined as a preprocessor macro that I mentioned. Because most likely it won't.
- googh 2y agoCan someone shed some light on why the parent comment (by varjag) is downvoted?