Skip to content

Commit

Permalink
Fold typemap into Fast.xs
Browse files Browse the repository at this point in the history
  • Loading branch information
JRaspass committed Oct 26, 2024
1 parent a5c3ad5 commit c22e339
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
14 changes: 14 additions & 0 deletions Fast.xs
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,20 @@ SvPV_stable_storage(pTHX_ SV *sv, STRLEN *lp)
MODULE = Cache::Memcached::Fast PACKAGE = Cache::Memcached::Fast


TYPEMAP: <<TYPEMAP
Cache_Memcached_Fast * T_CACHE_MEMCACHED_FAST

INPUT
T_CACHE_MEMCACHED_FAST
$var = INT2PTR($type, SvIVX(SvRV($arg)));

OUTPUT
T_CACHE_MEMCACHED_FAST
sv_setref_pv($arg, class, (void *) $var);

TYPEMAP


Cache_Memcached_Fast *
_new(char *class, SV *conf)
PROTOTYPE: $$
Expand Down
7 changes: 7 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,18 @@ my %args = (
},
},
},
BUILD_REQUIRES => {
'ExtUtils::ParseXS' => '3.12', # For embedded typemaps.
},
TEST_REQUIRES => {
'Test2::Suite' => '0.000072', # For Test2::V0.
},
);

# Merge BUILD_REQUIRES into PREREQ_PM if EU::MM is too old to understand.
$args{PREREQ_PM} = { %{ $args{PREREQ_PM} }, %{ delete $args{BUILD_REQUIRES} } }
unless eval { ExtUtils::MakeMaker->VERSION('6.55_03') };

# Merge TEST_REQUIRES into PREREQ_PM if EU::MM is too old to understand.
$args{PREREQ_PM} = { %{ $args{PREREQ_PM} }, %{ delete $args{TEST_REQUIRES} } }
unless eval { ExtUtils::MakeMaker->VERSION('6.64') };
Expand Down
4 changes: 4 additions & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ requires 'Carp' => '1.25'; # For trailing dot.
requires 'XSLoader' => '0.14'; # For XSLoader::load with no arguments.
requires 'perl' => 'v5.12';

on build => sub {
requires 'ExtUtils::ParseXS' => '3.12'; # For embedded typemaps.
};

on test => sub {
requires 'Test2::Suite' => '0.000072'; # For Test2::V0.
};
Expand Down
31 changes: 0 additions & 31 deletions typemap

This file was deleted.

0 comments on commit c22e339

Please sign in to comment.