macro: use raw pointer for CV parameter

so generated xsubs are actually compatible with
Value::new_xsub

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-01-07 15:54:49 +01:00
parent e5c95f0414
commit c25b213cc5

View File

@ -357,7 +357,7 @@ fn handle_return_kind(
wrapper_func = quote! {
#[doc(hidden)]
#vis extern "C" fn #xs_name(#pthx #cv_arg_name: &::perlmod::ffi::CV) {
#vis extern "C" fn #xs_name(#pthx #cv_arg_name: *mut ::perlmod::ffi::CV) {
unsafe {
match #impl_xs_name(#cv_arg_passed) {
Ok(()) => (),
@ -404,7 +404,7 @@ fn handle_return_kind(
wrapper_func = quote! {
#[doc(hidden)]
#vis extern "C" fn #xs_name(#pthx #cv_arg_name: &::perlmod::ffi::CV) {
#vis extern "C" fn #xs_name(#pthx #cv_arg_name: *mut ::perlmod::ffi::CV) {
unsafe {
match #impl_xs_name(#cv_arg_passed) {
Ok(sv) => ::perlmod::ffi::stack_push_raw(sv),
@ -490,7 +490,7 @@ fn handle_return_kind(
wrapper_func = quote! {
#[doc(hidden)]
#vis extern "C" fn #xs_name(#pthx #cv_arg_name: &::perlmod::ffi::CV) {
#vis extern "C" fn #xs_name(#pthx #cv_arg_name: *mut ::perlmod::ffi::CV) {
unsafe {
match #impl_xs_name(#cv_arg_passed) {
Ok(sv) => { #push },