Revert "Fix compilation issues with version older than 5.010"
authorNicolas R <atoomic@cpan.org>
Thu, 16 May 2019 22:47:37 +0000 (16:47 -0600)
committerNicolas R <atoomic@cpan.org>
Thu, 16 May 2019 22:47:37 +0000 (16:47 -0600)
This reverts commit a09f79fbc2455b7ea72a49f6627a639101ba35a2.

need to apply after current freeze

dist/Devel-PPPort/Makefile.PL
dist/Devel-PPPort/PPPort_pm.PL
dist/Devel-PPPort/parts/inc/misc
dist/Devel-PPPort/parts/inc/uv
dist/Devel-PPPort/parts/inc/warn
dist/Devel-PPPort/t/uv.t

index 7c2064a..8915a4d 100644 (file)
@@ -77,13 +77,13 @@ sub configure
     $depend{'apicheck.i'} = 'ppport.h';
   }
 
-  open FH, '<PPPort_pm.PL' or die "cannot open PPPort_pm.PL for reading: $!";
+  open my $fh, '<', 'PPPort_pm.PL' or die "cannot open PPPort_pm.PL for reading: $!";
   my $version;
-  while (my $line = <FH>) {
+  while (my $line = <$fh>) {
     ($version) = $line =~ /^\$VERSION = '([\d.]+)';$/ and last;
   };
   die 'failed to extract $VERSION from PPPort_pm.PL' if not $version;
-  close FH;
+  close $fh;
 
   return {
     C        => \@C_FILES,
index 19d5985..abce21d 100644 (file)
@@ -628,22 +628,16 @@ __DATA__
 
 %include limits
 
-%include magic_defs
-
 %include misc
 
-%include sv_xpvf
-
-%include SvPV
-
 %include warn
 
-%include format
-
 %include uv
 
 %include memory
 
+%include magic_defs
+
 %include mess
 
 %include variables
@@ -658,14 +652,20 @@ __DATA__
 
 %include MY_CXT
 
+%include format
+
 %include SvREFCNT
 
 %include newSV_type
 
 %include newSVpv
 
+%include SvPV
+
 %include Sv_set
 
+%include sv_xpvf
+
 %include shared_pv
 
 %include HvNAME
index 23a316f..2bd2dcf 100644 (file)
@@ -33,14 +33,6 @@ STMT_END
 STMT_START
 SvRX
 UTF8_MAXBYTES
-UTF8_ALLOW_ANYUV
-UTF8_ALLOW_EMPTY
-UTF8_ALLOW_CONTINUATION
-UTF8_ALLOW_NON_CONTINUATION
-UTF8_ALLOW_SHORT
-UTF8_ALLOW_LONG
-UTF8_ALLOW_OVERFLOW
-UTF8_ALLOW_ANY
 WIDEST_UTYPE
 XSRETURN
 
@@ -268,19 +260,6 @@ __UNDEFINED__  SVf             "_"
 
 __UNDEFINED__  UTF8_MAXBYTES   UTF8_MAXLEN
 
-__UNDEFINED__  UTF8_ALLOW_ANYUV                 0
-__UNDEFINED__  UTF8_ALLOW_EMPTY            0x0001
-__UNDEFINED__  UTF8_ALLOW_CONTINUATION     0x0002
-__UNDEFINED__  UTF8_ALLOW_NON_CONTINUATION 0x0004
-__UNDEFINED__  UTF8_ALLOW_SHORT            0x0008
-__UNDEFINED__  UTF8_ALLOW_LONG             0x0010
-__UNDEFINED__  UTF8_ALLOW_OVERFLOW         0x0080
-__UNDEFINED__  UTF8_ALLOW_ANY            ( UTF8_ALLOW_CONTINUATION      \
-                                          |UTF8_ALLOW_NON_CONTINUATION  \
-                                          |UTF8_ALLOW_SHORT             \
-                                          |UTF8_ALLOW_LONG              \
-                                          |UTF8_ALLOW_OVERFLOW)
-
 __UNDEFINED__  CPERLscope(x)   x
 
 __UNDEFINED__  PERL_HASH(hash,str,len) \
@@ -876,304 +855,266 @@ check_c_array()
                 mXPUSHi(*(C_ARRAY_END(x)-1)); /* 13 */
 
 bool
-test_isBLANK(ord)
-    UV ord
+test_isBLANK(UV ord)
     CODE:
         RETVAL = isBLANK(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isBLANK_A(ord)
-    UV ord
+test_isBLANK_A(UV ord)
     CODE:
         RETVAL = isBLANK_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isUPPER(ord)
-    UV ord
+test_isUPPER(UV ord)
     CODE:
         RETVAL = isUPPER(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isUPPER_A(ord)
-    UV ord
+test_isUPPER_A(UV ord)
     CODE:
         RETVAL = isUPPER_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isLOWER(ord)
-    UV ord
+test_isLOWER(UV ord)
     CODE:
         RETVAL = isLOWER(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isLOWER_A(ord)
-    UV ord
+test_isLOWER_A(UV ord)
     CODE:
         RETVAL = isLOWER_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isALPHA(ord)
-    UV ord
+test_isALPHA(UV ord)
     CODE:
         RETVAL = isALPHA(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isALPHA_A(ord)
-    UV ord
+test_isALPHA_A(UV ord)
     CODE:
         RETVAL = isALPHA_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isWORDCHAR(ord)
-    UV ord
+test_isWORDCHAR(UV ord)
     CODE:
         RETVAL = isWORDCHAR(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isWORDCHAR_A(ord)
-    UV ord
+test_isWORDCHAR_A(UV ord)
     CODE:
         RETVAL = isWORDCHAR_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isALPHANUMERIC(ord)
-    UV ord
+test_isALPHANUMERIC(UV ord)
     CODE:
         RETVAL = isALPHANUMERIC(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isALPHANUMERIC_A(ord)
-    UV ord
+test_isALPHANUMERIC_A(UV ord)
     CODE:
         RETVAL = isALPHANUMERIC_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isALNUM(ord)
-    UV ord
+test_isALNUM(UV ord)
     CODE:
         RETVAL = isALNUM(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isALNUM_A(ord)
-    UV ord
+test_isALNUM_A(UV ord)
     CODE:
         RETVAL = isALNUM_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isDIGIT(ord)
-    UV ord
+test_isDIGIT(UV ord)
     CODE:
         RETVAL = isDIGIT(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isDIGIT_A(ord)
-    UV ord
+test_isDIGIT_A(UV ord)
     CODE:
         RETVAL = isDIGIT_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isOCTAL(ord)
-    UV ord
+test_isOCTAL(UV ord)
     CODE:
         RETVAL = isOCTAL(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isOCTAL_A(ord)
-    UV ord
+test_isOCTAL_A(UV ord)
     CODE:
         RETVAL = isOCTAL_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isIDFIRST(ord)
-    UV ord
+test_isIDFIRST(UV ord)
     CODE:
         RETVAL = isIDFIRST(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isIDFIRST_A(ord)
-    UV ord
+test_isIDFIRST_A(UV ord)
     CODE:
         RETVAL = isIDFIRST_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isIDCONT(ord)
-    UV ord
+test_isIDCONT(UV ord)
     CODE:
         RETVAL = isIDCONT(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isIDCONT_A(ord)
-    UV ord
+test_isIDCONT_A(UV ord)
     CODE:
         RETVAL = isIDCONT_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isSPACE(ord)
-    UV ord
+test_isSPACE(UV ord)
     CODE:
         RETVAL = isSPACE(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isSPACE_A(ord)
-    UV ord
+test_isSPACE_A(UV ord)
     CODE:
         RETVAL = isSPACE_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isASCII(ord)
-    UV ord
+test_isASCII(UV ord)
     CODE:
         RETVAL = isASCII(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isASCII_A(ord)
-    UV ord
+test_isASCII_A(UV ord)
     CODE:
         RETVAL = isASCII_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isCNTRL(ord)
-    UV ord
+test_isCNTRL(UV ord)
     CODE:
         RETVAL = isCNTRL(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isCNTRL_A(ord)
-    UV ord
+test_isCNTRL_A(UV ord)
     CODE:
         RETVAL = isCNTRL_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isPRINT(ord)
-    UV ord
+test_isPRINT(UV ord)
     CODE:
         RETVAL = isPRINT(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isPRINT_A(ord)
-    UV ord
+test_isPRINT_A(UV ord)
     CODE:
         RETVAL = isPRINT_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isGRAPH(ord)
-    UV ord
+test_isGRAPH(UV ord)
     CODE:
         RETVAL = isGRAPH(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isGRAPH_A(ord)
-    UV ord
+test_isGRAPH_A(UV ord)
     CODE:
         RETVAL = isGRAPH_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isPUNCT(ord)
-    UV ord
+test_isPUNCT(UV ord)
     CODE:
         RETVAL = isPUNCT(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isPUNCT_A(ord)
-    UV ord
+test_isPUNCT_A(UV ord)
     CODE:
         RETVAL = isPUNCT_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isXDIGIT(ord)
-    UV ord
+test_isXDIGIT(UV ord)
     CODE:
         RETVAL = isXDIGIT(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isXDIGIT_A(ord)
-    UV ord
+test_isXDIGIT_A(UV ord)
     CODE:
         RETVAL = isXDIGIT_A(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isPSXSPC(ord)
-    UV ord
+test_isPSXSPC(UV ord)
     CODE:
         RETVAL = isPSXSPC(ord);
     OUTPUT:
         RETVAL
 
 bool
-test_isPSXSPC_A(ord)
-    UV ord
+test_isPSXSPC_A(UV ord)
     CODE:
         RETVAL = isPSXSPC_A(ord);
     OUTPUT:
@@ -1181,17 +1122,17 @@ test_isPSXSPC_A(ord)
 
 STRLEN
 av_tindex(av)
-        SV *av
+        AV *av
         CODE:
-                RETVAL = av_tindex((AV*)SvRV(av));
+                RETVAL = av_tindex(av);
         OUTPUT:
                 RETVAL
 
 STRLEN
 av_top_index(av)
-        SV *av
+        AV *av
         CODE:
-                RETVAL = av_top_index((AV*)SvRV(av));
+                RETVAL = av_top_index(av);
         OUTPUT:
                 RETVAL
 
index 3c03ba5..bb5f19e 100644 (file)
@@ -103,19 +103,13 @@ my_strnlen(const char *str, Size_t maxlen)
  * intended to work with modern perls, the tighter restrictions could be
  * relaxed.  khw thinks this is unlikely, but has been wrong in the past. */
 
-#if { VERSION < 5.10.0 }
-#  define D_PPP_CU8 U8
-#else
-#  define D_PPP_CU8 const U8
-#endif
-
 #ifndef utf8_to_uvchr_buf
    /* Choose which underlying implementation to use.  At least one must be
     * present or the perl is too early to handle this function */
 #  if defined(utf8n_to_uvchr) || defined(utf8_to_uv)
 #    if defined(utf8n_to_uvchr)   /* This is the preferred implementation */
 #      define _ppport_utf8_to_uvchr_buf_callee utf8n_to_uvchr
-#    elif { VERSION >= 5.6.1 }
+#    else
 #      define _ppport_utf8_to_uvchr_buf_callee utf8_to_uv
 #    endif
 
@@ -125,7 +119,7 @@ my_strnlen(const char *str, Size_t maxlen)
 #  if { NEED utf8_to_uvchr_buf }
 
 UV
-utf8_to_uvchr_buf(pTHX_ D_PPP_CU8 *s, const U8 *send, STRLEN *retlen)
+utf8_to_uvchr_buf(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen)
 {
     UV ret;
     STRLEN curlen;
@@ -364,11 +358,7 @@ UTF8_SAFE_SKIP(s, adjustment)
         int adjustment
         CODE:
             /* Instead of passing in an 'e' ptr, use the real end, adjusted */
-#if defined(UTF8_SAFE_SKIP) && defined(UTF8SKIP)
             RETVAL = UTF8_SAFE_SKIP(s, s + UTF8SKIP(s) + adjustment);
-#else
-            RETVAL = 0;
-#endif
         OUTPUT:
             RETVAL
 
@@ -390,14 +380,9 @@ utf8_to_uvchr_buf(s, adjustment)
             STRLEN len;
         CODE:
             av = newAV();
-#ifdef utf8_to_uvchr_buf
             av_push(av, newSVuv(utf8_to_uvchr_buf(s,
                                                   s + UTF8SKIP(s) + adjustment,
                                                   &len)));
-#else
-            av_push(av, newSVuv(0));
-            len = (STRLEN) -1;
-#endif
             if (len == (STRLEN) -1) {
                 av_push(av, newSViv(-1));
             }
@@ -416,12 +401,7 @@ utf8_to_uvchr(s)
             STRLEN len;
         CODE:
             av = newAV();
-#ifdef utf8_to_uvchr
             av_push(av, newSVuv(utf8_to_uvchr(s, &len)));
-#else
-            av_push(av, newSVuv(0));
-            len = (STRLEN) -1;
-#endif
             if (len == (STRLEN) -1) {
                 av_push(av, newSViv(-1));
             }
@@ -434,9 +414,6 @@ utf8_to_uvchr(s)
 
 =tests plan => 52
 
-# skip tests on 5.6.0 and earlier
-BEGIN { if ("$]" le '5.006') { skip 'skip: broken utf8 support', 0 for 1..52; exit; } }
-
 ok(&Devel::PPPort::sv_setuv(42), 42);
 ok(&Devel::PPPort::newSVuv(123), 123);
 ok(&Devel::PPPort::sv_2uv("4711"), 4711);
@@ -518,7 +495,7 @@ else {
         {                 # Old algorithm supposedly failed to detect this
             input      => "\xff\x80\x90\x90\x90\xbf\xbf\xbf\xbf\xbf\xbf\xbf\xbf",
             adjustment => 0,
-            warning    => ("$]" le 5.008006) ? qr/Malformed UTF-8 character/ : qr/overflow/,
+            warning    => qr/overflow/,
             no_warnings_returned_length => 13,
         },
     );
index df8a385..b4a5695 100644 (file)
@@ -105,7 +105,6 @@ warner(U32 err, const char *pat, ...)
 =xsinit
 
 #define NEED_warner
-#define NEED_vnewSVpvf
 
 =xsubs
 
index 5c8d487..7f5d78b 100644 (file)
@@ -48,9 +48,6 @@ bootstrap Devel::PPPort;
 
 package main;
 
-# skip tests on 5.6.0 and earlier
-BEGIN { if ("$]" le '5.006') { skip 'skip: broken utf8 support', 0 for 1..52; exit; } }
-
 ok(&Devel::PPPort::sv_setuv(42), 42);
 ok(&Devel::PPPort::newSVuv(123), 123);
 ok(&Devel::PPPort::sv_2uv("4711"), 4711);
@@ -132,7 +129,7 @@ else {
         {                 # Old algorithm supposedly failed to detect this
             input      => "\xff\x80\x90\x90\x90\xbf\xbf\xbf\xbf\xbf\xbf\xbf\xbf",
             adjustment => 0,
-            warning    => ("$]" le 5.008006) ? qr/Malformed UTF-8 character/ : qr/overflow/,
+            warning    => qr/overflow/,
             no_warnings_returned_length => 13,
         },
     );