You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm guessing this is just a case of things not being implemented yet, but what is required to let C functions return raw pointers?
For example this code
use std::os::raw::c_char;#[cxx::bridge]mod ffi {extern"C"{include!("vendor/bzip2/bzlib.h");fnBZ2_bzlibVersion() -> *constc_char;}}
Fails to compile with
Compiling cxx-experiment v0.1.0 (/home/michael/Documents/cxx-experiment)
error: unsupported type
--> src/lib.rs:8:34
|
8 | fn BZ2_bzlibVersion() -> *const c_char;
| ^^^^^^^^^^^^^
warning: unused import: `std::os::raw::c_char`
--> src/lib.rs:1:5
|
1 | use std::os::raw::c_char;
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
error: aborting due to previous error
error: could not compile `cxx-experiment`.
To learn more, run the command again with --verbose.
The text was updated successfully, but these errors were encountered:
So far I am not decided on supporting raw pointers, but currently leaning against. I'd like to see if we can instead specialize toward interfaces that are structured to make it possible to always decide "is this code correct" without looking at the other language.
I'm guessing this is just a case of things not being implemented yet, but what is required to let C functions return raw pointers?
For example this code
Fails to compile with
The text was updated successfully, but these errors were encountered: