in reply to Why does the h2xs -x switch not generate XSUBs?
That 'void' in the argument list would be, I think, incorrect if included in the XS functions. (It's certainly not needed, anyway.)// libtwintree.c: #include "libtwintree.h" int return_one() { return 1; } int return_zero() { return 0; }
TwinTree.pm:#include "EXTERN.h" #include "perl.h" #include "XSUB.h" // libtwintree.c: #include "libtwintree.h" int return_one() { return 1; } int return_zero() { return 0; } MODULE = TwinTree PACKAGE = TwinTree PROTOTYPES: DISABLE int return_one () int return_zero ()
Makefile.PL:package TwinTree; use strict; require Exporter; *import = \&Exporter::import; require DynaLoader; $TwinTree::VERSION = '0.01'; DynaLoader::bootstrap TwinTree $TwinTree::VERSION; @TwinTree::EXPORT = (); @TwinTree::EXPORT_OK = (); sub dl_load_flags {0} # Prevent DynaLoader from complaining and croaki +ng 1;
That's using version 0.14, which has only just been uploaded to CPAN, amd may take a while to reach all mirrors. Version 0.13 is quite functional, but adds the cwd to INC and the standard perl typemaps to TYPEMAP in the Makefile.PL - which neither breaks nor achieves anything (but is a bit annoying).use ExtUtils::MakeMaker; my %options = %{ { 'TYPEMAPS' => [], 'NAME' => 'TwinTree', 'INC' => '', 'VERSION' => '0.01' } }; WriteMakefile(%options); # Remove the Makefile dependency. Causes problems on a few systems. sub MY::makefile { '' }
|
|---|