diff --git a/Changes b/Changes index 28a30d2..de32554 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension NetAddr::IP +4.019 Sat Nov 29 15:15:30 PST 2008 + in Lite/Util, add pure perl testing to XS build + 4.018 Fri Nov 28 23:19:01 PST 2008 revised XS code to be full re-entrant, thread safe in Util.xs v1.26 removed all traces of mutex locks in Util.xs v1.26 diff --git a/IP.pm b/IP.pm index 015946b..26ff7f1 100644 --- a/IP.pm +++ b/IP.pm @@ -34,7 +34,7 @@ @ISA = qw(Exporter NetAddr::IP::Lite); -$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.18 $ =~ /\d+/g) }; +$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.19 $ =~ /\d+/g) }; =pod @@ -2053,6 +2053,14 @@ Thanks to kashmish for the idea on improving functionality of 'split'. +=item 4.018 + + removed --with-threads, PTHREADS support, and all + the mutex locking - unlocking + + updated Util.xs to be fully re-entrant and thus + fully thread safe. + =back =head1 AUTHORS diff --git a/Lite/Util/Makefile.PL b/Lite/Util/Makefile.PL index 8af7a00..e44e90f 100644 --- a/Lite/Util/Makefile.PL +++ b/Lite/Util/Makefile.PL @@ -15,7 +15,7 @@ # # get any command line arguments # -my($withthreads,$useXS); +my($useXS); GetOptions( 'xs!' => \$useXS, 'pm' => sub { @@ -210,6 +210,35 @@ $begin . $inherited; } +sub MY::test { + package MY; + my $inherited = shift->SUPER::test(@_); + return $inherited unless $useXS; + my @orig = split(/\n/,$inherited); + my @txt = @orig; + my @lines; + + foreach(@orig) { + if ($_ !~ /^(?:test|testdb)_\w+/ && $_ =~ /^(test[^\s]*)\s+:/) { + my $new = ' pp'.$1; + $_ .= $new; + } + } + + foreach(@txt) { + $_ =~ s/TEST_TYPE/MTEST_TYPE/g; + next if $_ =~ /^#/ || /^TEST/; + $_ =~ s/subdirs/ppsubdirs/g; + $_ =~ s/test_/pptest_/g + unless $_ =~ /harness/; + $_ =~ s/testdb_/pptestdb_/g; + $_ =~ s/^test/pptest/; + $_ =~ s/([^\s]+)\$\(INST_LIB\)([^\s]+)/${1}tlib$2 $&/; + push @lines, $_; + } + my $line = join("\n",@orig,@lines); +} + sub MY::post_constants { my $post_constants = q| MY_POD2TEXT = |. $Config{scriptdirexp} .'/pod2text' .q| diff --git a/Lite/Util/tlib/NetAddr/IP/Util_IS.pm b/Lite/Util/tlib/NetAddr/IP/Util_IS.pm new file mode 100644 index 0000000..5d58917 --- /dev/null +++ b/Lite/Util/tlib/NetAddr/IP/Util_IS.pm @@ -0,0 +1,51 @@ +#!/usr/bin/perl +# +# DO NOT ALTER THIS FILE +# IT IS WRITTEN BY Makefile.PL +# EDIT THAT INSTEAD +# +package NetAddr::IP::Util_IS; +use vars qw($VERSION); +$VERSION = 1.00; + + +sub pure { + return 1; +} +sub not_pure { + return 0; +} +1; +__END__ + +=head1 NAME + +NetAddr::IP::Util_IS - Tell about Pure Perl + +=head1 SYNOPSIS + + use NetAddr::IP::Util_IS; + + $rv = NetAddr::IP::Util_IS->pure; + $rv = NetAddr::IP::Util_IS->not_pure; + +=head1 DESCRIPTION + +Util_IS indicates whether or not B was compiled in Pure +Perl mode. + +=over 4 + +=item * $rv = NetAddr::IP::Util_IS->pure; + +Returns true if PurePerl mode, else false. + +=item * $rv = NetAddr::IP::Util_IS->not_pure; + +Returns true if NOT PurePerl mode, else false + +=back + +=cut + +1; diff --git a/MANIFEST b/MANIFEST index 332567f..9ae7209 100644 --- a/MANIFEST +++ b/MANIFEST @@ -66,6 +66,7 @@ Lite/Util/config.h.in Lite/Util/GPL Lite/Util/lib/NetAddr/IP/UtilPP.pm +Lite/Util/tlib/NetAddr/IP/Util_IS.pm Lite/Util/localconf.h Lite/Util/Makefile.PL Lite/Util/README diff --git a/META.yml b/META.yml index f394bdd..f3d25c8 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: NetAddr-IP -version: 4.018 +version: 4.019 abstract: Manages IPv4 and IPv6 addresses and subnets license: ~ author: