From e1b6c960b5ab304f320ee63b1e2572a7883e17ef Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 6 Sep 2011 09:21:24 -0500 Subject: fix compilation on perl 5.8 (RT#70762) --- Changes | 1 + XS.xs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 6d86cbf..aa1fd34 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Package-Stash-XS {{$NEXT}} + - fix compilation on perl 5.8 (RT#70762) 0.24 2011-09-05 - invalid package names (for instance, Foo:Bar) are not allowed diff --git a/XS.xs b/XS.xs index 7015e3e..2a0fd9a 100644 --- a/XS.xs +++ b/XS.xs @@ -804,10 +804,18 @@ get_all_symbols(self, vartype=VAR_NONE) BOOT: { + const char *vmre = "\\A[0-9A-Z_a-z]+(?:::[0-9A-Z_a-z]+)*\\z"; +#if (PERL_VERSION < 9) || ((PERL_VERSION == 9) && (PERL_SUBVERSION < 5)) + PMOP fakepmop; + + fakepmop.op_pmflags = 0; + valid_module_regex = pregcomp(vmre, vmre + strlen(vmre), &fakepmop); +#else SV *re; - re = newSVpv("\\A[0-9A-Z_a-z]+(?:::[0-9A-Z_a-z]+)*\\z", 0); + re = newSVpv(vmre, 0); valid_module_regex = pregcomp(re, 0); +#endif name_key = newSVpvs("name"); PERL_HASH(name_hash, "name", 4); -- cgit v1.2.3-54-g00ecf