mirror of
https://github.com/openharmony/third_party_rust_cxx.git
synced 2026-07-01 05:39:22 -04:00
+49
-49
@@ -212,7 +212,7 @@ fn expand_struct_operators(strct: &Struct) -> TokenStream {
|
||||
let prevent_unwind_label = format!("::{} as PartialEq>::eq", strct.name.rust);
|
||||
operators.extend(quote_spanned! {span=>
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_name)]
|
||||
#[export_name = #link_name]
|
||||
extern "C" fn #local_name #generics(lhs: &#ident #generics, rhs: &#ident #generics) -> bool {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_label);
|
||||
::cxx::private::prevent_unwind(__fn, || *lhs == *rhs)
|
||||
@@ -225,7 +225,7 @@ fn expand_struct_operators(strct: &Struct) -> TokenStream {
|
||||
let prevent_unwind_label = format!("::{} as PartialEq>::ne", strct.name.rust);
|
||||
operators.extend(quote_spanned! {span=>
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_name)]
|
||||
#[export_name = #link_name]
|
||||
extern "C" fn #local_name #generics(lhs: &#ident #generics, rhs: &#ident #generics) -> bool {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_label);
|
||||
::cxx::private::prevent_unwind(__fn, || *lhs != *rhs)
|
||||
@@ -239,7 +239,7 @@ fn expand_struct_operators(strct: &Struct) -> TokenStream {
|
||||
let prevent_unwind_label = format!("::{} as PartialOrd>::lt", strct.name.rust);
|
||||
operators.extend(quote_spanned! {span=>
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_name)]
|
||||
#[export_name = #link_name]
|
||||
extern "C" fn #local_name #generics(lhs: &#ident #generics, rhs: &#ident #generics) -> bool {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_label);
|
||||
::cxx::private::prevent_unwind(__fn, || *lhs < *rhs)
|
||||
@@ -251,7 +251,7 @@ fn expand_struct_operators(strct: &Struct) -> TokenStream {
|
||||
let prevent_unwind_label = format!("::{} as PartialOrd>::le", strct.name.rust);
|
||||
operators.extend(quote_spanned! {span=>
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_name)]
|
||||
#[export_name = #link_name]
|
||||
extern "C" fn #local_name #generics(lhs: &#ident #generics, rhs: &#ident #generics) -> bool {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_label);
|
||||
::cxx::private::prevent_unwind(__fn, || *lhs <= *rhs)
|
||||
@@ -264,7 +264,7 @@ fn expand_struct_operators(strct: &Struct) -> TokenStream {
|
||||
let prevent_unwind_label = format!("::{} as PartialOrd>::gt", strct.name.rust);
|
||||
operators.extend(quote_spanned! {span=>
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_name)]
|
||||
#[export_name = #link_name]
|
||||
extern "C" fn #local_name #generics(lhs: &#ident #generics, rhs: &#ident #generics) -> bool {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_label);
|
||||
::cxx::private::prevent_unwind(__fn, || *lhs > *rhs)
|
||||
@@ -276,7 +276,7 @@ fn expand_struct_operators(strct: &Struct) -> TokenStream {
|
||||
let prevent_unwind_label = format!("::{} as PartialOrd>::ge", strct.name.rust);
|
||||
operators.extend(quote_spanned! {span=>
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_name)]
|
||||
#[export_name = #link_name]
|
||||
extern "C" fn #local_name #generics(lhs: &#ident #generics, rhs: &#ident #generics) -> bool {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_label);
|
||||
::cxx::private::prevent_unwind(__fn, || *lhs >= *rhs)
|
||||
@@ -290,7 +290,7 @@ fn expand_struct_operators(strct: &Struct) -> TokenStream {
|
||||
let prevent_unwind_label = format!("::{} as Hash>::hash", strct.name.rust);
|
||||
operators.extend(quote_spanned! {span=>
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_name)]
|
||||
#[export_name = #link_name]
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
extern "C" fn #local_name #generics(this: &#ident #generics) -> usize {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_label);
|
||||
@@ -728,7 +728,7 @@ fn expand_cxx_function_shim(efn: &ExternFn, types: &Types) -> TokenStream {
|
||||
let generics = &efn.generics;
|
||||
let arg_list = quote_spanned!(efn.sig.paren_token.span=> (#(#all_args,)*));
|
||||
let fn_body = quote_spanned!(span=> {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#decl
|
||||
}
|
||||
#trampolines
|
||||
@@ -803,7 +803,7 @@ fn expand_function_pointer_trampoline(
|
||||
quote! {
|
||||
let #var = ::cxx::private::FatFunction {
|
||||
trampoline: {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #c_trampoline]
|
||||
fn trampoline();
|
||||
}
|
||||
@@ -903,12 +903,12 @@ fn expand_rust_type_layout(ety: &ExternType, types: &Types) -> TokenStream {
|
||||
::cxx::core::alloc::Layout::new::<T>()
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_sizeof)]
|
||||
#[export_name = #link_sizeof]
|
||||
extern "C" fn #local_sizeof() -> usize {
|
||||
__AssertSized::<#ident #lifetimes>().size()
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_alignof)]
|
||||
#[export_name = #link_alignof]
|
||||
extern "C" fn #local_alignof() -> usize {
|
||||
__AssertSized::<#ident #lifetimes>().align()
|
||||
}
|
||||
@@ -1158,7 +1158,7 @@ fn expand_rust_function_shim_impl(
|
||||
quote_spanned! {span=>
|
||||
#attrs
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_name)]
|
||||
#[export_name = #link_name]
|
||||
unsafe extern "C" fn #local_name #generics(#(#all_args,)* #outparam #pointer) #ret {
|
||||
let __fn = ::cxx::private::concat!(::cxx::private::module_path!(), #prevent_unwind_label);
|
||||
#wrap_super
|
||||
@@ -1299,7 +1299,7 @@ fn expand_rust_box(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
#[doc(hidden)]
|
||||
#unsafe_token impl #impl_generics ::cxx::private::ImplBox for #ident #ty_generics {}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_alloc)]
|
||||
#[export_name = #link_alloc]
|
||||
unsafe extern "C" fn #local_alloc #impl_generics() -> *mut ::cxx::core::mem::MaybeUninit<#ident #ty_generics> {
|
||||
// No prevent_unwind: the global allocator is not allowed to panic.
|
||||
//
|
||||
@@ -1309,13 +1309,13 @@ fn expand_rust_box(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
::cxx::alloc::boxed::Box::into_raw(::cxx::alloc::boxed::Box::new(::cxx::core::mem::MaybeUninit::uninit()))
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_dealloc)]
|
||||
#[export_name = #link_dealloc]
|
||||
unsafe extern "C" fn #local_dealloc #impl_generics(ptr: *mut ::cxx::core::mem::MaybeUninit<#ident #ty_generics>) {
|
||||
// No prevent_unwind: the global allocator is not allowed to panic.
|
||||
let _ = unsafe { ::cxx::alloc::boxed::Box::from_raw(ptr) };
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_drop)]
|
||||
#[export_name = #link_drop]
|
||||
unsafe extern "C" fn #local_drop #impl_generics(this: *mut ::cxx::alloc::boxed::Box<#ident #ty_generics>) {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_drop_label);
|
||||
::cxx::private::prevent_unwind(__fn, || unsafe { ::cxx::core::ptr::drop_in_place(this) });
|
||||
@@ -1357,7 +1357,7 @@ fn expand_rust_vec(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
#[doc(hidden)]
|
||||
#unsafe_token impl #impl_generics ::cxx::private::ImplVec for #elem #ty_generics {}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_new)]
|
||||
#[export_name = #link_new]
|
||||
unsafe extern "C" fn #local_new #impl_generics(this: *mut ::cxx::private::RustVec<#elem #ty_generics>) {
|
||||
// No prevent_unwind: cannot panic.
|
||||
unsafe {
|
||||
@@ -1365,7 +1365,7 @@ fn expand_rust_vec(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
}
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_drop)]
|
||||
#[export_name = #link_drop]
|
||||
unsafe extern "C" fn #local_drop #impl_generics(this: *mut ::cxx::private::RustVec<#elem #ty_generics>) {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_drop_label);
|
||||
::cxx::private::prevent_unwind(
|
||||
@@ -1374,25 +1374,25 @@ fn expand_rust_vec(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
);
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_len)]
|
||||
#[export_name = #link_len]
|
||||
unsafe extern "C" fn #local_len #impl_generics(this: *const ::cxx::private::RustVec<#elem #ty_generics>) -> usize {
|
||||
// No prevent_unwind: cannot panic.
|
||||
unsafe { (*this).len() }
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_capacity)]
|
||||
#[export_name = #link_capacity]
|
||||
unsafe extern "C" fn #local_capacity #impl_generics(this: *const ::cxx::private::RustVec<#elem #ty_generics>) -> usize {
|
||||
// No prevent_unwind: cannot panic.
|
||||
unsafe { (*this).capacity() }
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_data)]
|
||||
#[export_name = #link_data]
|
||||
unsafe extern "C" fn #local_data #impl_generics(this: *const ::cxx::private::RustVec<#elem #ty_generics>) -> *const #elem #ty_generics {
|
||||
// No prevent_unwind: cannot panic.
|
||||
unsafe { (*this).as_ptr() }
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_reserve_total)]
|
||||
#[export_name = #link_reserve_total]
|
||||
unsafe extern "C" fn #local_reserve_total #impl_generics(this: *mut ::cxx::private::RustVec<#elem #ty_generics>, new_cap: usize) {
|
||||
// No prevent_unwind: the global allocator is not allowed to panic.
|
||||
unsafe {
|
||||
@@ -1400,7 +1400,7 @@ fn expand_rust_vec(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
}
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_set_len)]
|
||||
#[export_name = #link_set_len]
|
||||
unsafe extern "C" fn #local_set_len #impl_generics(this: *mut ::cxx::private::RustVec<#elem #ty_generics>, len: usize) {
|
||||
// No prevent_unwind: cannot panic.
|
||||
unsafe {
|
||||
@@ -1408,7 +1408,7 @@ fn expand_rust_vec(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
}
|
||||
}
|
||||
#[doc(hidden)]
|
||||
#[#UnsafeAttr(#ExportNameAttr = #link_truncate)]
|
||||
#[export_name = #link_truncate]
|
||||
unsafe extern "C" fn #local_truncate #impl_generics(this: *mut ::cxx::private::RustVec<#elem #ty_generics>, len: usize) {
|
||||
let __fn = concat!("<", module_path!(), #prevent_unwind_drop_label);
|
||||
::cxx::private::prevent_unwind(
|
||||
@@ -1441,7 +1441,7 @@ fn expand_unique_ptr(
|
||||
let new_method = if can_construct_from_value {
|
||||
Some(quote! {
|
||||
fn __new(value: Self) -> ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void> {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_uninit]
|
||||
fn __uninit(this: *mut ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) -> *mut ::cxx::core::ffi::c_void;
|
||||
}
|
||||
@@ -1466,7 +1466,7 @@ fn expand_unique_ptr(
|
||||
f.write_str(#name)
|
||||
}
|
||||
fn __null() -> ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void> {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_null]
|
||||
fn __null(this: *mut ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>);
|
||||
}
|
||||
@@ -1478,7 +1478,7 @@ fn expand_unique_ptr(
|
||||
}
|
||||
#new_method
|
||||
unsafe fn __raw(raw: *mut Self) -> ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void> {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_raw]
|
||||
fn __raw(this: *mut ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>, raw: *mut ::cxx::core::ffi::c_void);
|
||||
}
|
||||
@@ -1489,21 +1489,21 @@ fn expand_unique_ptr(
|
||||
repr
|
||||
}
|
||||
unsafe fn __get(repr: ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) -> *const Self {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_get]
|
||||
fn __get(this: *const ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) -> *const ::cxx::core::ffi::c_void;
|
||||
}
|
||||
unsafe { __get(&repr).cast() }
|
||||
}
|
||||
unsafe fn __release(mut repr: ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) -> *mut Self {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_release]
|
||||
fn __release(this: *mut ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) -> *mut ::cxx::core::ffi::c_void;
|
||||
}
|
||||
unsafe { __release(&mut repr).cast() }
|
||||
}
|
||||
unsafe fn __drop(mut repr: ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_drop]
|
||||
fn __drop(this: *mut ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>);
|
||||
}
|
||||
@@ -1536,7 +1536,7 @@ fn expand_shared_ptr(
|
||||
let new_method = if can_construct_from_value {
|
||||
Some(quote! {
|
||||
unsafe fn __new(value: Self, new: *mut ::cxx::core::ffi::c_void) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_uninit]
|
||||
fn __uninit(new: *mut ::cxx::core::ffi::c_void) -> *mut ::cxx::core::ffi::c_void;
|
||||
}
|
||||
@@ -1559,7 +1559,7 @@ fn expand_shared_ptr(
|
||||
f.write_str(#name)
|
||||
}
|
||||
unsafe fn __null(new: *mut ::cxx::core::ffi::c_void) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_null]
|
||||
fn __null(new: *mut ::cxx::core::ffi::c_void);
|
||||
}
|
||||
@@ -1569,7 +1569,7 @@ fn expand_shared_ptr(
|
||||
}
|
||||
#new_method
|
||||
unsafe fn __clone(this: *const ::cxx::core::ffi::c_void, new: *mut ::cxx::core::ffi::c_void) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_clone]
|
||||
fn __clone(this: *const ::cxx::core::ffi::c_void, new: *mut ::cxx::core::ffi::c_void);
|
||||
}
|
||||
@@ -1578,14 +1578,14 @@ fn expand_shared_ptr(
|
||||
}
|
||||
}
|
||||
unsafe fn __get(this: *const ::cxx::core::ffi::c_void) -> *const Self {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_get]
|
||||
fn __get(this: *const ::cxx::core::ffi::c_void) -> *const ::cxx::core::ffi::c_void;
|
||||
}
|
||||
unsafe { __get(this).cast() }
|
||||
}
|
||||
unsafe fn __drop(this: *mut ::cxx::core::ffi::c_void) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_drop]
|
||||
fn __drop(this: *mut ::cxx::core::ffi::c_void);
|
||||
}
|
||||
@@ -1620,7 +1620,7 @@ fn expand_weak_ptr(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
f.write_str(#name)
|
||||
}
|
||||
unsafe fn __null(new: *mut ::cxx::core::ffi::c_void) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_null]
|
||||
fn __null(new: *mut ::cxx::core::ffi::c_void);
|
||||
}
|
||||
@@ -1629,7 +1629,7 @@ fn expand_weak_ptr(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
}
|
||||
}
|
||||
unsafe fn __clone(this: *const ::cxx::core::ffi::c_void, new: *mut ::cxx::core::ffi::c_void) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_clone]
|
||||
fn __clone(this: *const ::cxx::core::ffi::c_void, new: *mut ::cxx::core::ffi::c_void);
|
||||
}
|
||||
@@ -1638,7 +1638,7 @@ fn expand_weak_ptr(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
}
|
||||
}
|
||||
unsafe fn __downgrade(shared: *const ::cxx::core::ffi::c_void, weak: *mut ::cxx::core::ffi::c_void) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_downgrade]
|
||||
fn __downgrade(shared: *const ::cxx::core::ffi::c_void, weak: *mut ::cxx::core::ffi::c_void);
|
||||
}
|
||||
@@ -1647,7 +1647,7 @@ fn expand_weak_ptr(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
}
|
||||
}
|
||||
unsafe fn __upgrade(weak: *const ::cxx::core::ffi::c_void, shared: *mut ::cxx::core::ffi::c_void) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_upgrade]
|
||||
fn __upgrade(weak: *const ::cxx::core::ffi::c_void, shared: *mut ::cxx::core::ffi::c_void);
|
||||
}
|
||||
@@ -1656,7 +1656,7 @@ fn expand_weak_ptr(key: NamedImplKey, types: &Types, explicit_impl: Option<&Impl
|
||||
}
|
||||
}
|
||||
unsafe fn __drop(this: *mut ::cxx::core::ffi::c_void) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_drop]
|
||||
fn __drop(this: *mut ::cxx::core::ffi::c_void);
|
||||
}
|
||||
@@ -1705,7 +1705,7 @@ fn expand_cxx_vector(
|
||||
this: ::cxx::core::pin::Pin<&mut ::cxx::CxxVector<Self>>,
|
||||
value: &mut ::cxx::core::mem::ManuallyDrop<Self>,
|
||||
) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_push_back]
|
||||
fn __push_back #impl_generics(
|
||||
this: ::cxx::core::pin::Pin<&mut ::cxx::CxxVector<#elem #ty_generics>>,
|
||||
@@ -1723,7 +1723,7 @@ fn expand_cxx_vector(
|
||||
this: ::cxx::core::pin::Pin<&mut ::cxx::CxxVector<Self>>,
|
||||
out: &mut ::cxx::core::mem::MaybeUninit<Self>,
|
||||
) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_pop_back]
|
||||
fn __pop_back #impl_generics(
|
||||
this: ::cxx::core::pin::Pin<&mut ::cxx::CxxVector<#elem #ty_generics>>,
|
||||
@@ -1748,21 +1748,21 @@ fn expand_cxx_vector(
|
||||
f.write_str(#name)
|
||||
}
|
||||
fn __vector_new() -> *mut ::cxx::CxxVector<Self> {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_new]
|
||||
fn __vector_new #impl_generics() -> *mut ::cxx::CxxVector<#elem #ty_generics>;
|
||||
}
|
||||
unsafe { __vector_new() }
|
||||
}
|
||||
fn __vector_size(v: &::cxx::CxxVector<Self>) -> usize {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_size]
|
||||
fn __vector_size #impl_generics(_: &::cxx::CxxVector<#elem #ty_generics>) -> usize;
|
||||
}
|
||||
unsafe { __vector_size(v) }
|
||||
}
|
||||
unsafe fn __get_unchecked(v: *mut ::cxx::CxxVector<Self>, pos: usize) -> *mut Self {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_get_unchecked]
|
||||
fn __get_unchecked #impl_generics(
|
||||
v: *mut ::cxx::CxxVector<#elem #ty_generics>,
|
||||
@@ -1773,7 +1773,7 @@ fn expand_cxx_vector(
|
||||
}
|
||||
#by_value_methods
|
||||
fn __unique_ptr_null() -> ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void> {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_unique_ptr_null]
|
||||
fn __unique_ptr_null(this: *mut ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>);
|
||||
}
|
||||
@@ -1784,7 +1784,7 @@ fn expand_cxx_vector(
|
||||
repr
|
||||
}
|
||||
unsafe fn __unique_ptr_raw(raw: *mut ::cxx::CxxVector<Self>) -> ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void> {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_unique_ptr_raw]
|
||||
fn __unique_ptr_raw #impl_generics(this: *mut ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>, raw: *mut ::cxx::CxxVector<#elem #ty_generics>);
|
||||
}
|
||||
@@ -1795,21 +1795,21 @@ fn expand_cxx_vector(
|
||||
repr
|
||||
}
|
||||
unsafe fn __unique_ptr_get(repr: ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) -> *const ::cxx::CxxVector<Self> {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_unique_ptr_get]
|
||||
fn __unique_ptr_get #impl_generics(this: *const ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) -> *const ::cxx::CxxVector<#elem #ty_generics>;
|
||||
}
|
||||
unsafe { __unique_ptr_get(&repr) }
|
||||
}
|
||||
unsafe fn __unique_ptr_release(mut repr: ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) -> *mut ::cxx::CxxVector<Self> {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_unique_ptr_release]
|
||||
fn __unique_ptr_release #impl_generics(this: *mut ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) -> *mut ::cxx::CxxVector<#elem #ty_generics>;
|
||||
}
|
||||
unsafe { __unique_ptr_release(&mut repr) }
|
||||
}
|
||||
unsafe fn __unique_ptr_drop(mut repr: ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>) {
|
||||
#UnsafeExtern extern "C" {
|
||||
extern "C" {
|
||||
#[link_name = #link_unique_ptr_drop]
|
||||
fn __unique_ptr_drop(this: *mut ::cxx::core::mem::MaybeUninit<*mut ::cxx::core::ffi::c_void>);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user