in reply to Wrapping a C shared library with Perl and XS
Then create a ./XS-Wrap-0.42 source distro directory.#include <stdio.h> #include <xswrap.h> void _arr (){ unsigned char* c_array = arr(); inline_stack_vars; inline_stack_reset; int i; for (i=0; i<3; i++){ inline_stack_push(sv_2mortal(newSViv(c_array[i]))); } inline_stack_done; }
Then run perl build_src.pluse warnings; use strict; use InlineX::C2XS qw(c2xs); my $options = {WRITE_PM => 1, WRITE_MAKEFILE_PL => 1, VERSION => '0.42', MANIF => 1, T => 1, EXPORT_OK_ALL => 1, EXPORT_TAGS_ALL => 'all', }; c2xs('XS::Wrap', 'XS::Wrap', './XS-Wrap-0.42', $options);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Wrapping a C shared library with Perl and XS
by stevieb (Canon) on Mar 18, 2017 at 03:07 UTC | |
|
Re^2: Wrapping a C shared library with Perl and XS
by stevieb (Canon) on Mar 18, 2017 at 03:19 UTC | |
by syphilis (Archbishop) on Mar 18, 2017 at 05:45 UTC |