Comments (6)
Just a quick update: The vtables before were absolutely wrong anyway (didn't take into account destructors, etc.).
Also, MSVC packs virtual method overrides differently from the rest of the compilers, so this will require target-specific code (which is not a huge deal though, we already do it).
In any case, this is still a major amount of work, though certainly useful. I'll consider implementing it if there's enough need for it, though the logic is surely complex.
from rust-bindgen.
I was searching for information regarding this feature in bindgen. As I understand, it still has to be done as of may 2018. Is there any hope it will be considered at some point? Thanks
from rust-bindgen.
It's not really trivial, someone needs to go ahead and implement it properly, and add a bunch of tests. I'd be happy to mentor, though I'm not sure if I'd have the time to do it myself.
from rust-bindgen.
This is basically a matter of implementing this:
rust-bindgen/src/codegen/mod.rs
Lines 997 to 1018 in 91d9600
Which already has a reference to all methods and base classes. Making this work for simple casses (no base classes, no overloaded methods) should be trivial. From there we can improve.
from rust-bindgen.
Is this fixed via #2145?
from rust-bindgen.
Yes, use this to generate a basic vtable
let bindings = bindgen::Builder::default()
.header("wrapper.hpp")
.clang_arg("-x")
.clang_arg("c++")
.clang_arg("-std=c++11")
.derive_default(true)
.derive_debug(true)
.vtable_generation(true)
.generate_comments(false)
.layout_tests(false)
.generate_comments(false)
.derive_copy(true)
.derive_hash(false)
.parse_callbacks(Box::new(MyCallback {}))
.generate()
.expect("Unable to generate bindings");
With .vtable_generation(true)
.
from rust-bindgen.
Related Issues (20)
- Blocklist/allowlist based on header HOT 2
- Simplify target conversion further
- UINTMAX64 can never be generated HOT 2
- can not get the non-type template arg?
- allowlist_item does not work for anonymous enums - allowlist_var does HOT 1
- --target=wasm32-unknown-unknown: 'stdio.h' file not found HOT 5
- Unable to generate bindings for Arduino library IRremote.hpp on MacOS HOT 1
- Thread panicking at bindgen .Err state unable to found libclang.dll but it available on the path variable HOT 2
- feature request: Enable deriving `Clone`, `Copy`, etc... for `__IncompleteArrayField` and containing structs. HOT 2
- Support for raw-dylib for Windows
- Support for one set of bindings depending on another (conflicting `__BindgenBitfieldUnit`) HOT 3
- Unable to run bindgen on ubuntu 22.04 HOT 2
- update requirements for OpenBSD HOT 10
- Building tests for LightGBM bindings failes with linker error
- Unable to prevent Clang headers from being used
- Update clang-sys HOT 2
- AArch64 Linux va_list not FFI-safe
- "rustified_non_exhaustive_enum" not supported in CLI
- 0.69 introduces issue with constantly rebuilding
- bindgen has bumped MSRV without updating semver HOT 5
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 rust-bindgen.