Releases: dtolnay/cxx
Releases · dtolnay/cxx
0.5.1
- Enable functions to have a different name between Rust and C++ (#349)
- Within cxx::bridge, write #[rust_name = "..."] or #[cxx_name = "..."] to make a change to either name of a function
- In general many functions can have the same C++ name (due to overloading); every function must continue to have a unique Rust name
#[cxx::bridge]
mod ffi {
extern "C++" {
include!("path/to/header.h");
#[cxx_name = "take"]
fn take_int(i: i32);
#[cxx_name = "take"] // different overload of the same name in C++
fn take_str(s: &str);
}
}
0.5.0
- Enable extern type aliases to be passed and returned by value across the FFI as long as an
unsafe impl ExternType
impl claims that the underlying C++ type is trivially move constructible and trivially destructible; see https://docs.rs/cxx/0.5.0/cxx/trait.ExternType.html#associatedtype.Kind (#325, thanks @adetaylor) - Expose a way for particular generic type instantiations of std::unique_ptr and std::vector, like
UniquePtr<MyType>
, to be produced on demand (#336) - Enable import of handwritten as well as generated headers from direct dependencies in the Cargo-based workflow; see https://docs.rs/cxx-build/0.5.0/cxx_build/static.CFG.html#cfginclude_prefix (#346, #347)
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
-
Fix various sources of brittleness in the Cargo-based workflow (#88, #213)
-
Breaking change: the default #include path set up for your build by
cxx_build::bridge
now contains the crate name as the first component of paths. So if your crate name is my-crate and cxx_build::bridge is invoked with "src/lib.rs" as the local path, the resulting generated header would be includable from C++ as#include "my-crate/src/lib.rs.h"
. Headers from dependencies are now also available exactly the same way: their crate name followed by local path within the crate.