Sub-Name-0.28 v0.28
Karen Etheridge [Sun, 15 Dec 2024 20:59:45 +0000 (12:59 -0800)]
    - fix version comparison logic for forward compatibility

CONTRIBUTING
Changes
LICENCE
README.pod
ppport.h

index 4b752c1..45be8a6 100644 (file)
@@ -92,6 +92,10 @@ Results will be visible in the pull request on GitHub. Follow the appropriate
 links for details when tests fail. Changes will not be mergeable until all
 tests pass.
 
+Generated files such as README, CONTRIBUTING, Makefile.PL, LICENSE etc should
+*not* be included in your pull request, as they will be updated automatically
+during the next release.
+
 If you have found a bug, but do not have an accompanying patch to fix it, you
 can submit an issue report here:
 https://rt.cpan.org/Public/Dist/Display.html?Name=Sub-Name
@@ -108,4 +112,4 @@ request to the .mailmap file to contain the correct mapping.
 
 
 This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.015
-from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.162.
+from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.164.
diff --git a/Changes b/Changes
index e7a9e65..531e2e0 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,6 @@
 Revision history for Sub-Name
 
-{{$NEXT}}
+0.28      2024-12-15 20:57:44Z
     - fix version comparison logic for forward compatibility
 
 0.27      2023-04-29 12:32:26Z
diff --git a/LICENCE b/LICENCE
index 8a47c5f..e94dab5 100644 (file)
--- a/LICENCE
+++ b/LICENCE
@@ -270,110 +270,143 @@ necessary.  Here a sample; alter the names:
 That's all there is to it!
 
 
---- The Artistic License 1.0 ---
+--- The Perl Artistic License 1.0 ---
 
 This software is Copyright (c) 2004 by Matthijs van Duin and cPanel Inc.
 
 This is free software, licensed under:
 
-  The Artistic License 1.0
+  The Perl Artistic License 1.0
 
-The Artistic License
 
-Preamble
 
-The intent of this document is to state the conditions under which a Package
-may be copied, such that the Copyright Holder maintains some semblance of
-artistic control over the development of the package, while giving the users of
-the package the right to use and distribute the Package in a more-or-less
-customary fashion, plus the right to make reasonable modifications.
+
+
+                         The "Artistic License"
+
+                                Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
 
 Definitions:
 
-  - "Package" refers to the collection of files distributed by the Copyright
-    Holder, and derivatives of that collection of files created through
-    textual modification.
-  - "Standard Version" refers to such a Package if it has not been modified,
-    or has been modified in accordance with the wishes of the Copyright
-    Holder.
-  - "Copyright Holder" is whoever is named in the copyright or copyrights for
-    the package.
-  - "You" is you, if you're thinking about copying or distributing this Package.
-  - "Reasonable copying fee" is whatever you can justify on the basis of media
-    cost, duplication charges, time of people involved, and so on. (You will
-    not be required to justify it to the Copyright Holder, but only to the
-    computing community at large as a market that must bear the fee.)
-  - "Freely Available" means that no fee is charged for the item itself, though
-    there may be fees involved in handling the item. It also means that
-    recipients of the item may redistribute it under the same conditions they
-    received it.
+        "Package" refers to the collection of files distributed by the
+        Copyright Holder, and derivatives of that collection of files
+        created through textual modification.
+
+        "Standard Version" refers to such a Package if it has not been
+        modified, or has been modified in accordance with the wishes
+        of the Copyright Holder as specified below.
+
+        "Copyright Holder" is whoever is named in the copyright or
+        copyrights for the package.
+
+        "You" is you, if you're thinking about copying or distributing
+        this Package.
+
+        "Reasonable copying fee" is whatever you can justify on the
+        basis of media cost, duplication charges, time of people involved,
+        and so on.  (You will not be required to justify it to the
+        Copyright Holder, but only to the computing community at large
+        as a market that must bear the fee.)
+
+        "Freely Available" means that no fee is charged for the item
+        itself, though there may be fees involved in handling the item.
+        It also means that recipients of the item may redistribute it
+        under the same conditions they received it.
 
 1. You may make and give away verbatim copies of the source form of the
 Standard Version of this Package without restriction, provided that you
 duplicate all of the original copyright notices and associated disclaimers.
 
-2. You may apply bug fixes, portability fixes and other modifications derived
-from the Public Domain or from the Copyright Holder. A Package modified in such
-a way shall still be considered the Standard Version.
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain or from the Copyright Holder.  A Package
+modified in such a way shall still be considered the Standard Version.
 
-3. You may otherwise modify your copy of this Package in any way, provided that
-you insert a prominent notice in each changed file stating how and when you
-changed that file, and provided that you do at least ONE of the following:
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
 
-  a) place your modifications in the Public Domain or otherwise make them
-     Freely Available, such as by posting said modifications to Usenet or an
-     equivalent medium, or placing the modifications on a major archive site
-     such as ftp.uu.net, or by allowing the Copyright Holder to include your
-     modifications in the Standard Version of the Package.
+    a) place your modifications in the Public Domain or otherwise make them
+    Freely Available, such as by posting said modifications to Usenet or
+    an equivalent medium, or placing the modifications on a major archive
+    site such as uunet.uu.net, or by allowing the Copyright Holder to include
+    your modifications in the Standard Version of the Package.
 
-  b) use the modified Package only within your corporation or organization.
+    b) use the modified Package only within your corporation or organization.
 
-  c) rename any non-standard executables so the names do not conflict with
-     standard executables, which must also be provided, and provide a separate
-     manual page for each non-standard executable that clearly documents how it
-     differs from the Standard Version.
+    c) rename any non-standard executables so the names do not conflict
+    with standard executables, which must also be provided, and provide
+    a separate manual page for each non-standard executable that clearly
+    documents how it differs from the Standard Version.
 
-  d) make other distribution arrangements with the Copyright Holder.
+    d) make other distribution arrangements with the Copyright Holder.
 
-4. You may distribute the programs of this Package in object code or executable
-form, provided that you do at least ONE of the following:
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
 
-  a) distribute a Standard Version of the executables and library files,
-     together with instructions (in the manual page or equivalent) on where to
-     get the Standard Version.
+    a) distribute a Standard Version of the executables and library files,
+    together with instructions (in the manual page or equivalent) on where
+    to get the Standard Version.
 
-  b) accompany the distribution with the machine-readable source of the Package
-     with your modifications.
+    b) accompany the distribution with the machine-readable source of
+    the Package with your modifications.
 
-  c) accompany any non-standard executables with their corresponding Standard
-     Version executables, giving the non-standard executables non-standard
-     names, and clearly documenting the differences in manual pages (or
-     equivalent), together with instructions on where to get the Standard
-     Version.
+    c) give non-standard executables non-standard names, and clearly
+    document the differences in manual pages (or equivalent), together
+    with instructions on where to get the Standard Version.
 
-  d) make other distribution arrangements with the Copyright Holder.
+    d) make other distribution arrangements with the Copyright Holder.
 
 5. You may charge a reasonable copying fee for any distribution of this
-Package.  You may charge any fee you choose for support of this Package. You
-may not charge a fee for this Package itself. However, you may distribute this
-Package in aggregate with other (possibly commercial) programs as part of a
-larger (possibly commercial) software distribution provided that you do not
-advertise this Package as a product of your own.
-
-6. The scripts and library files supplied as input to or produced as output
-from the programs of this Package do not automatically fall under the copyright
-of this Package, but belong to whomever generated them, and may be sold
-commercially, and may be aggregated with this Package.
-
-7. C or perl subroutines supplied by you and linked into this Package shall not
-be considered part of this Package.
-
-8. The name of the Copyright Holder may not be used to endorse or promote
+Package.  You may charge any fee you choose for support of this
+Package.  You may not charge a fee for this Package itself.  However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial) software
+distribution provided that you do not advertise this Package as a
+product of your own.  You may embed this Package's interpreter within
+an executable of yours (by linking); this shall be construed as a mere
+form of aggregation, provided that the complete Standard Version of the
+interpreter is so embedded.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whoever generated
+them, and may be sold commercially, and may be aggregated with this
+Package.  If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of this
+Package.
+
+7. C subroutines (or comparably compiled subroutines in other
+languages) supplied by you and linked into this Package in order to
+emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. Aggregation of this Package with a commercial distribution is always
+permitted provided that the use of this Package is embedded; that is,
+when no overt attempt is made to make this Package's interfaces visible
+to the end user of the commercial distribution.  Such use shall not be
+construed as a distribution of this Package.
+
+9. The name of the Copyright Holder may not be used to endorse or promote
 products derived from this software without specific prior written permission.
 
-9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
-The End
+                                The End
 
index a8dcea3..510c35f 100644 (file)
@@ -8,7 +8,7 @@ Sub::Name - (Re)name a sub
 
 =head1 VERSION
 
-version 0.27
+version 0.28
 
 =head1 SYNOPSIS
 
index f3fdd1d..db5d503 100644 (file)
--- a/ppport.h
+++ b/ppport.h
@@ -4,9 +4,9 @@ my $void = <<'SKIP';
 /*
 ----------------------------------------------------------------------
 
-    ppport.h -- Perl/Pollution/Portability Version 3.71
+    ppport.h -- Perl/Pollution/Portability Version 3.73
 
-    Automatically created by Devel::PPPort running under perl 5.037011.
+    Automatically created by Devel::PPPort running under perl 5.041006.
 
     Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
     includes in parts/inc/ instead.
@@ -21,7 +21,7 @@ SKIP
 
 =head1 NAME
 
-ppport.h - Perl/Pollution/Portability version 3.71
+ppport.h - Perl/Pollution/Portability version 3.73
 
 =head1 SYNOPSIS
 
@@ -588,7 +588,7 @@ BEGIN { require warnings if "$]" > '5.006' }
 # Disable broken TRIE-optimization
 BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if "$]" >= "5.009004" && "$]" <= "5.009005"}
 
-my $VERSION = 3.71;
+my $VERSION = 3.73;
 
 my %opt = (
   quiet     => 0,
@@ -7087,7 +7087,9 @@ PerlSock_socket_cloexec|5.027008||Viu
 PerlSock_socketpair|5.005000||Viu
 PerlSock_socketpair_cloexec|5.027008||Viu
 Perl_sqrt|5.006000|5.006000|n
+PERL_STACK_OFFSET_DEFINED|||piu
 PERL_STACK_OVERFLOW_CHECK|5.006000||Viu
+PERL_STACK_REALIGN|||piu
 PERL_STATIC_FORCE_INLINE|5.031011||Viu
 PERL_STATIC_FORCE_INLINE_NO_RET|5.031011||Viu
 PERL_STATIC_INLINE|5.013004|5.013004|poVn
@@ -8895,6 +8897,8 @@ SSPUSHPTR|5.003007||Viu
 SSPUSHUV|5.013001||Viu
 ST|5.003007|5.003007|
 stack_grow|5.003007||cVu
+Stack_off_t_MAX|||piu
+Stack_off_t|||piu
 STANDARD_C|5.003007||Viu
 STAR|5.003007||Viu
 STAR_t8|5.035004||Viu
@@ -9020,7 +9024,7 @@ sv_2mortal|5.003007|5.003007|
 sv_2num|5.010000||xVi
 sv_2nv|5.013001||Viu
 sv_2nv_flags|5.013001|5.013001|
-sv_2pv|5.005000||cVu
+sv_2pv|5.005000||pcVu
 sv_2pvbyte|5.006000|5.003007|p
 sv_2pvbyte_flags|5.031004|5.031004|u
 sv_2pvbyte_nolen|5.009003||pcV
@@ -9442,7 +9446,7 @@ sv_recode_to_utf8|5.007003|5.007003|
 sv_ref|5.023005|5.023005|
 SvREFCNT|5.003007|5.003007|
 SvREFCNT_dec|5.003007|5.003007|
-SvREFCNT_dec_NN|5.017007|5.017007|
+SvREFCNT_dec_NN|5.017007|5.017007|p
 SvREFCNT_IMMORTAL|5.017008||Viu
 SvREFCNT_inc|5.003007|5.003007|pn
 SvREFCNT_inc_NN|5.009004|5.003007|pn
@@ -11567,7 +11571,7 @@ __DATA__
 #define DPPP_CAT2(x,y) CAT2(x,y)
 #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
 
-#define D_PPP_RELEASE_DATE 1647561600 /* 2022-03-18 */
+#define D_PPP_RELEASE_DATE 1693785600 /* 2023-09-04 */
 
 #if ! defined(PERL_REVISION) && ! defined(PERL_VERSION_MAJOR)
 #  if   !   defined(__PATCHLEVEL_H_INCLUDED__)                                  \
@@ -11679,8 +11683,8 @@ __DATA__
  * is in ASCII and EBCDIC respectively */
 #ifndef PERL_VERSION_EQ
 #  define PERL_VERSION_EQ(j,n,p)         \
-              (((p) == '*') ? (   (j) == D_PPP_VERSION_MAJOR                \
-                               && (n) == D_PPP_VERSION_MINOR)               \
+              (((p) == '*') ? (   (j) == D_PPP_MAJOR                        \
+                               && (n) == D_PPP_MINOR)                       \
                             : (PERL_BCDVERSION == D_PPP_JNP_TO_BCD(j,n,p)))
 #endif
 
@@ -11689,7 +11693,7 @@ __DATA__
 #endif
 #ifndef PERL_VERSION_LT
 #  define PERL_VERSION_LT(j,n,p)         /* p=='*' means _LT(j,n,0) */     \
-    (PERL_BCDVERSION < D_PPP_JNP_TO_BCD(                    (j),            \
+    (PERL_BCDVERSION < D_PPP_JNP_TO_BCD(                     (j),           \
                                                              (n),           \
                                          (((p) == '*') ? 0 : (p))))
 #endif
@@ -11698,10 +11702,10 @@ __DATA__
 #  define PERL_VERSION_GE(j,n,p)         (! PERL_VERSION_LT(j,n,p))
 #endif
 #ifndef PERL_VERSION_LE
-#  define PERL_VERSION_LE(j,n,p)         /* p=='*' means _LT(j,n+1,0) */   \
-    (PERL_BCDVERSION < D_PPP_JNP_TO_BCD(                          (j),      \
-                                         (((p) == '*') ? ((n)+1) : (n)),    \
-                                         (((p) == '*') ?   0     : (p))))
+#  define PERL_VERSION_LE(j,n,p)         /* p=='*' means _LE(j,n,999) */   \
+    (PERL_BCDVERSION <= D_PPP_JNP_TO_BCD(                      (j),         \
+                                                               (n),         \
+                                         (((p) == '*') ? 999 : (p))))
 #endif
 
 #ifndef PERL_VERSION_GT
@@ -12510,6 +12514,19 @@ DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
 #endif
 
 #endif
+
+/* work around a stack alignment bug in 32-bit GCC on Windows */
+#if defined(WIN32) && !defined(WIN64) && defined(__GNUC__)
+#ifndef PERL_STACK_REALIGN
+#  define PERL_STACK_REALIGN             __attribute__((force_align_arg_pointer))
+#endif
+
+#else
+#ifndef PERL_STACK_REALIGN
+#  define PERL_STACK_REALIGN
+#endif
+
+#endif
 #ifndef cBOOL
 #  define cBOOL(cbool)                   ((cbool) ? (bool)1 : (bool)0)
 #endif
@@ -12770,6 +12787,12 @@ typedef NVTYPE NV;
 #    define PTR2ul(p)     INT2PTR(unsigned long,p)
 #  endif
 #endif
+
+#ifndef PERL_STACK_OFFSET_DEFINED
+  typedef I32 Stack_off_t;
+#  define Stack_off_t_MAX I32_MAX
+#  define PERL_STACK_OFFSET_DEFINED
+#endif
 #ifndef PTR2nat
 #  define PTR2nat(p)                     (PTRV)(p)
 #endif
@@ -12790,17 +12813,38 @@ typedef NVTYPE NV;
 #  define PTR2NV(p)                      NUM2PTR(NV,p)
 #endif
 
+#ifdef __cplusplus
 #undef START_EXTERN_C
+#ifndef START_EXTERN_C
+#  define START_EXTERN_C                 extern "C" {
+#endif
+
 #undef END_EXTERN_C
+#ifndef END_EXTERN_C
+#  define END_EXTERN_C                   }
+#endif
+
 #undef EXTERN_C
-#ifdef __cplusplus
-#  define START_EXTERN_C extern "C" {
-#  define END_EXTERN_C }
-#  define EXTERN_C extern "C"
+#ifndef EXTERN_C
+#  define EXTERN_C                       extern "C"
+#endif
+
 #else
+#undef START_EXTERN_C
+#ifndef START_EXTERN_C
 #  define START_EXTERN_C
+#endif
+
+#undef END_EXTERN_C
+#ifndef END_EXTERN_C
 #  define END_EXTERN_C
-#  define EXTERN_C extern
+#endif
+
+#undef EXTERN_C
+#ifndef EXTERN_C
+#  define EXTERN_C                       extern
+#endif
+
 #endif
 
 #if (PERL_BCDVERSION < 0x5004000) || defined(PERL_GCC_PEDANTIC)
@@ -12820,14 +12864,28 @@ typedef NVTYPE NV;
 #  endif
 #endif
 
+#if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
 #undef STMT_START
+#ifndef STMT_START
+#  define STMT_START                     if (1)
+#endif
+
 #undef STMT_END
-#if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
-#    define STMT_START  if (1)
-#    define STMT_END    else (void)0
+#ifndef STMT_END
+#  define STMT_END                       else (void)0
+#endif
+
 #else
-#    define STMT_START  do
-#    define STMT_END    while (0)
+#undef STMT_START
+#ifndef STMT_START
+#  define STMT_START                     do
+#endif
+
+#undef STMT_END
+#ifndef STMT_END
+#  define STMT_END                       while (0)
+#endif
+
 #endif
 #ifndef boolSV
 #  define boolSV(b)                      ((b) ? &PL_sv_yes : &PL_sv_no)
@@ -12919,13 +12977,16 @@ typedef NVTYPE NV;
 #endif
 
 #if (PERL_BCDVERSION < 0x5005000)
-#  undef XSRETURN
-#  define XSRETURN(off)                                   \
+#undef XSRETURN
+#ifndef XSRETURN
+#  define XSRETURN(off)                  \
       STMT_START {                                        \
           PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
           return;                                         \
       } STMT_END
 #endif
+
+#endif
 #ifndef XSPROTO
 #  define XSPROTO(name)                  void name(pTHX_ CV* cv)
 #endif
@@ -13732,7 +13793,8 @@ typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
 #  define isPRINT_utf8_safe(s,e)         D_PPP_IS_GENERIC_UTF8_SAFE(s, e, PRINT)
 #endif
 
-#  undef isPSXSPC_utf8_safe   /* Use the modern definition */
+/* Use the modern definition */
+#undef isPSXSPC_utf8_safe
 #ifndef isPSXSPC_utf8_safe
 #  define isPSXSPC_utf8_safe(s,e)        isSPACE_utf8_safe(s,e)
 #endif
@@ -13856,7 +13918,8 @@ typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
 #  define isPRINT_LC_utf8_safe(s,e)      D_PPP_IS_GENERIC_LC_UTF8_SAFE(s, e, PRINT)
 #endif
 
-#  undef isPSXSPC_LC_utf8_safe   /* Use the modern definition */
+/* Use the modern definition */
+#undef isPSXSPC_LC_utf8_safe
 #ifndef isPSXSPC_LC_utf8_safe
 #  define isPSXSPC_LC_utf8_safe(s,e)     isSPACE_LC_utf8_safe(s,e)
 #endif
@@ -14399,13 +14462,39 @@ DPPP_(my_sv_setpvf_mg_nocontext)(SV * const sv, const char * const pat, ...)
 #  define SV_COW_SHARED_HASH_KEYS        0
 #endif
 
+#if (PERL_BCDVERSION < 0x5007002)
+#
+/* Fix sv_2pv for Perl < 5.7.2 - view https://github.com/Dual-Life/Devel-PPPort/issues/231 */
+
+# ifdef sv_2pv
+#  undef sv_2pv
+# endif
+
+# if defined(PERL_USE_GCC_BRACE_GROUPS)
+#ifndef sv_2pv
+#  define sv_2pv(sv, lp)                 ({ SV *_sv_2pv = (sv); STRLEN sv_2pv_dummy_; STRLEN *_lp_2pv = (lp); _lp_2pv = _lp_2pv ? : &sv_2pv_dummy_; SvPOKp(_sv_2pv) ? ((*(_lp_2pv) = SvCUR(_sv_2pv)), SvPVX(_sv_2pv)) : Perl_sv_2pv(aTHX_ _sv_2pv, (_lp_2pv)); })
+#endif
+
+# else
+#ifndef sv_2pv
+#  define sv_2pv(sv, lp)                 (SvPOKp(sv) ? ((*((lp) ? (lp) : &PL_na) = SvCUR(sv)), SvPVX(sv)) : Perl_sv_2pv(aTHX_ (sv), (lp)))
+#endif
+
+# endif
+
+#endif
+
+#if (PERL_BCDVERSION < 0x5007002)
+
+/* Define sv_2pv_flags for Perl < 5.7.2 which does not have it at all */
+
 #if defined(PERL_USE_GCC_BRACE_GROUPS)
 #ifndef sv_2pv_flags
-#  define sv_2pv_flags(sv, lp, flags)    ({ SV *_sv = (sv); const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &PL_na; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_2pv(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_2pv(_sv, _lp); })
+#  define sv_2pv_flags(sv, lp, flags)    ({ SV *_sv = (sv); STRLEN sv_2pv_dummy_; const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &sv_2pv_dummy_; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_2pv(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_2pv(_sv, _lp); })
 #endif
 
 #ifndef sv_pvn_force_flags
-#  define sv_pvn_force_flags(sv, lp, flags) ({ SV *_sv = (sv); const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &PL_na; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_pvn_force(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_pvn_force(_sv, _lp); })
+#  define sv_pvn_force_flags(sv, lp, flags) ({ SV *_sv = (sv); STRLEN sv_2pv_dummy_; const I32 _flags = (flags); STRLEN *_lp = lp; _lp = _lp ? : &sv_2pv_dummy_; (!(_flags & SV_GMAGIC) && SvGMAGICAL(_sv)) ? ({ char *_pv; SvGMAGICAL_off(_sv); _pv = sv_pvn_force(_sv, _lp); SvGMAGICAL_on(_sv); _pv; }) : sv_pvn_force(_sv, _lp); })
 #endif
 
 #else
@@ -14419,6 +14508,28 @@ DPPP_(my_sv_setpvf_mg_nocontext)(SV * const sv, const char * const pat, ...)
 
 #endif
 
+#elif (PERL_BCDVERSION < 0x5017002)
+
+/* Fix sv_2pv_flags for Perl < 5.17.2 */
+
+# ifdef sv_2pv_flags
+#  undef sv_2pv_flags
+# endif
+
+# if defined(PERL_USE_GCC_BRACE_GROUPS)
+#ifndef sv_2pv_flags
+#  define sv_2pv_flags(sv, lp, flags)    ({ SV *_sv_2pv = (sv); STRLEN sv_2pv_dummy_; const I32 _flags_2pv = (flags); STRLEN *_lp_2pv = (lp); _lp_2pv = _lp_2pv ? : &sv_2pv_dummy_; ((!(_flags_2pv & SV_GMAGIC) || !SvGMAGICAL(_sv_2pv)) && SvPOKp(_sv_2pv)) ? ((*(_lp_2pv) = SvCUR(_sv_2pv)), SvPVX(_sv_2pv)) : Perl_sv_2pv_flags(aTHX_ _sv_2pv, (_lp_2pv), (_flags_2pv)); })
+#endif
+
+# else
+#ifndef sv_2pv_flags
+#  define sv_2pv_flags(sv, lp, flags)    (((!((flags) & SV_GMAGIC) || !SvGMAGICAL(sv)) && SvPOKp(sv)) ? ((*((lp) ? (lp) : &PL_na) = SvCUR(sv)), SvPVX(sv)) : Perl_sv_2pv_flags(aTHX_ (sv), (lp), (flags)))
+#endif
+
+# endif
+
+#endif
+
 #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
 # define D_PPP_SVPV_NOLEN_LP_ARG &PL_na
 #else
@@ -15835,6 +15946,11 @@ DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
           (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
 #  endif
 #endif
+
+/* not as efficient as the real thing, but it works */
+#ifndef SvREFCNT_dec_NN
+#  define SvREFCNT_dec_NN(sv)            SvREFCNT_dec(sv)
+#endif
 #ifndef SvREFCNT_inc_simple_void
 #  define SvREFCNT_inc_simple_void(sv)   STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
 #endif