On 2016-03-07 11:56:49, VYF wrote:
Show quoted text> It is, in fact, auto-generated. But it is also the minimum Perl
> version I have tested it on, and since perlmodstyle suggests that
> distributions should specify minimum Perl version I kept it as is.
Putting wrong minimum perl version requirements is actually worse than specifying no minimum version. If you don't know what's the minimum version then the correct way is to put the distribution on CPAN (maybe as a non-stable release) and to let CPAN Testers smoke the module. If there's a minimum perl version already specified, then CPAN Testers would not test the distribution for older perls at all.
Unfortunately, your case is somewhat more difficult, as few CPAN Testers have libgccjit installed. So CPAN Testers is currently full of "UNKNOWN" reports. Still my point is still valid.
Show quoted text> That said, I am all for making that more accurate. If you could
> confirm that the module also works on an earlier version I would be
> more than happy to adjust the requirement or apply the patch.
See the attached patch. The only trick is to replace av_top_index (introduced in 5.17.9) by av_len. I tried this successfully with perl 5.10.1 (at least "make test" passes), but I think it should also work with perl 5.8.x. So still I think there should be no minimum perl version specification --- let CPAN Testers do the work.
Regards,
Slaven
Show quoted text>
> On Thu Mar 03 02:00:00 2016, SREZIC wrote:
From 6ddfdc3244009ca0e0d0b09c20fcf78b4aa4779f Mon Sep 17 00:00:00 2001
From: Slaven Rezic <slaven@rezic.de>
Date: Wed, 9 Mar 2016 08:44:29 +0100
Subject: [PATCH] compatibility for older perls
* replace av_top_index by av_len (the former is only defined in perl 5.17.9 and later)
* remove minimum perl specifications (5.10.1 is fine, and most probably older perls, too)
---
Makefile.PL | 1 -
av_to_pp.h | 4 ++--
lib/GCCJIT.pm | 1 -
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/Makefile.PL b/Makefile.PL
index f6debc0..f60c980 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,4 +1,3 @@
-use 5.020002;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
diff --git a/av_to_pp.h b/av_to_pp.h
index ccb5ff9..d2d82a0 100644
--- a/av_to_pp.h
+++ b/av_to_pp.h
@@ -1,7 +1,7 @@
void **av_to_pp(pTHX_ AV* av, char *ctx, char *avname, char *typename)
{
void **ptr;
- SSize_t idx, size = av_top_index(av) + 1;
+ SSize_t idx, size = av_len(av) + 1;
if (size == 0)
return NULL;
@@ -25,7 +25,7 @@ void **av_to_pp(pTHX_ AV* av, char *ctx, char *avname, char *typename)
int num_##av;
#define AVPP_CODE(av, ctx, type, typename) { \
- num_##av = av_top_index(av) + 1; \
+ num_##av = av_len(av) + 1; \
ptr_##av = (type*) av_to_pp(aTHX_ av, ctx, #av, typename); \
}
diff --git a/lib/GCCJIT.pm b/lib/GCCJIT.pm
index be91b4d..56cd068 100644
--- a/lib/GCCJIT.pm
+++ b/lib/GCCJIT.pm
@@ -1,6 +1,5 @@
package GCCJIT;
-use 5.020002;
use strict;
use warnings;
use Carp;
--
2.6.4