-
Notifications
You must be signed in to change notification settings - Fork 38
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
bindgen generation wrapper for cli use #74
Conversation
So I have tried using this approach, but it does not really work on my laptop (x86_64): error[E0308]: mismatched types
--> src/c_helpers.rs:109:57
|
109 | xmlSetStructuredErrorFunc(ctxt as *mut c_void, Some(_ignoreInvalidTagsErrorFunc));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "C" fn, found "Rust" fn
|
= note: expected fn pointer `unsafe extern "C" fn(_, _)`
found fn item `fn(_, _) {c_helpers::_ignoreInvalidTagsErrorFunc}`
error[E0308]: mismatched types
--> src/schemas/parser.rs:82:14
|
82 | Some(common::structured_error_handler),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "C" fn, found "Rust" fn
|
= note: expected fn pointer `unsafe extern "C" fn(_, _)`
found fn item `fn(_, _) {schemas::common::structured_error_handler}`
error[E0308]: mismatched types
--> src/schemas/validation.rs:104:14
|
104 | Some(common::structured_error_handler),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "C" fn, found "Rust" fn
|
= note: expected fn pointer `unsafe extern "C" fn(_, _)`
found fn item `fn(_, _) {schemas::common::structured_error_handler}` |
and also: error[E0425]: cannot find value `HACKY_WELL_FORMED` in this scope
--> src/c_helpers.rs:101:7
|
101 | HACKY_WELL_FORMED = true;
| ^^^^^^^^^^^^^^^^^ not found in this scope
error[E0425]: cannot find value `HACKY_WELL_FORMED` in this scope
--> src/c_helpers.rs:108:5
|
108 | HACKY_WELL_FORMED = false;
| ^^^^^^^^^^^^^^^^^ not found in this scope
error[E0425]: cannot find value `HACKY_WELL_FORMED` in this scope
--> src/c_helpers.rs:114:59
|
114 | unsafe { (!ctxt.is_null() && (*ctxt).wellFormed > 0) || HACKY_WELL_FORMED }
| ^^^^^^^^^^^^^^^^^ not found in this scope |
FYI, I use |
It seems that |
|
With this bindgen command, I am down to just one relevant failure: error[E0308]: mismatched types
--> src/c_helpers.rs:109:57
|
109 | xmlSetStructuredErrorFunc(ctxt as *mut c_void, Some(_ignoreInvalidTagsErrorFunc));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "C" fn, found "Rust" fn
|
= note: expected fn pointer `unsafe extern "C" fn(_, _)`
found fn item `fn(_, _) {c_helpers::_ignoreInvalidTagsErrorFunc}`
error[E0308]: mismatched types
--> src/schemas/parser.rs:82:14
|
82 | Some(common::structured_error_handler),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "C" fn, found "Rust" fn
|
= note: expected fn pointer `unsafe extern "C" fn(_, _)`
found fn item `fn(_, _) {schemas::common::structured_error_handler}`
error[E0308]: mismatched types
--> src/schemas/validation.rs:104:14
|
104 | Some(common::structured_error_handler),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "C" fn, found "Rust" fn
|
= note: expected fn pointer `unsafe extern "C" fn(_, _)`
found fn item `fn(_, _) {schemas::common::structured_error_handler}`
error: aborting due to 3 previous errors |
Hi @ignatenkobrain , I realize the PR is not completed, as I mentioned just "some steps" towards a solution. The traces are a bit distracting here to be honest, as much as I like the friendly messages of rustc. As you noticed, |
935747d
to
456cdf0
Compare
Actually I'll close to avoid the wrong impression that I'm planning on working on this further myself. The general problem remains unsolved. |
Bundles in a script that allows for directly regenerating
src/bindings.rs
via:Some steps towards #73