Mailing List Archive

r3774 - branches/maint_0.1x/src
Author: creamyg
Date: 2008-08-27 13:52:49 -0700 (Wed, 27 Aug 2008)
New Revision: 3774

Modified:
branches/maint_0.1x/src/ppport.h
Log:
Update ppport.h.


Modified: branches/maint_0.1x/src/ppport.h
===================================================================
--- branches/maint_0.1x/src/ppport.h 2008-08-27 20:26:12 UTC (rev 3773)
+++ branches/maint_0.1x/src/ppport.h 2008-08-27 20:52:49 UTC (rev 3774)
@@ -4,9 +4,9 @@
/*
----------------------------------------------------------------------

- ppport.h -- Perl/Pollution/Portability Version 3.11
+ ppport.h -- Perl/Pollution/Portability Version 3.14

- Automatically created by Devel::PPPort running under perl 5.008006.
+ Automatically created by Devel::PPPort running under perl 5.008007.

Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
includes in parts/inc/ instead.
@@ -21,7 +21,7 @@

=head1 NAME

-ppport.h - Perl/Pollution/Portability version 3.11
+ppport.h - Perl/Pollution/Portability version 3.14

=head1 SYNOPSIS

@@ -56,7 +56,7 @@
=head1 COMPATIBILITY

This version of F<ppport.h> is designed to support operation with Perl
-installations back to 5.003, and has been tested up to 5.9.4.
+installations back to 5.003, and has been tested up to 5.10.0.

=head1 OPTIONS

@@ -78,7 +78,10 @@

If this option is given, a copy of each file will be saved with
the given suffix that contains the suggested changes. This does
-not require any external programs.
+not require any external programs. Note that this does not
+automagially add a dot between the original filename and the
+suffix. If you want the dot, you have to include it in the option
+argument.

If neither C<--patch> or C<--copy> are given, the default is to
simply print the diffs for each file. This requires either
@@ -117,7 +120,7 @@
=head2 --nohints

Don't output any hints. Hints often contain useful portability
-notes.
+notes. Warnings will still be displayed.

=head2 --nochanges

@@ -144,7 +147,7 @@

Lists the API elements for which compatibility is provided by
F<ppport.h>. Also lists if it must be explicitly requested,
-if it has dependencies, and if there are hints for it.
+if it has dependencies, and if there are hints or warnings for it.

=head2 --list-unsupported

@@ -221,17 +224,22 @@
grok_number() NEED_grok_number NEED_grok_number_GLOBAL
grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL
grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL
+ load_module() NEED_load_module NEED_load_module_GLOBAL
my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL
my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL
my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL
newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL
newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL
- sv_2pv_nolen() NEED_sv_2pv_nolen NEED_sv_2pv_nolen_GLOBAL
+ newSVpvn_flags() NEED_newSVpvn_flags NEED_newSVpvn_flags_GLOBAL
+ newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL
+ sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL
sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL
sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL
sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL
+ sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL
sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL
sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL
+ vload_module() NEED_vload_module NEED_vload_module_GLOBAL
vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL
warner() NEED_warner NEED_warner_GLOBAL

@@ -282,6 +290,10 @@

This would output context diffs with 10 lines of context.

+If you want to create patched copies of your files instead, use:
+
+ perl ppport.h --copy=.new
+
To display portability information for the C<newSVpvn> function,
use:

@@ -340,7 +352,7 @@

=head1 COPYRIGHT

-Version 3.x, Copyright (c) 2004-2007, Marcus Holland-Moritz.
+Version 3.x, Copyright (c) 2004-2008, Marcus Holland-Moritz.

Version 2.x, Copyright (C) 2001, Paul Marquess.

@@ -357,8 +369,11 @@

use strict;

-my $VERSION = 3.11;
+# Disable broken TRIE-optimization
+BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }

+my $VERSION = 3.14;
+
my %opt = (
quiet => 0,
diag => 1,
@@ -374,6 +389,12 @@
my $LF = '(?:\r\n|[\r\n])'; # line feed
my $HS = "[ \t]"; # horizontal whitespace

+# Never use C comments in this file!
+my $ccs = '/'.'*';
+my $cce = '*'.'/';
+my $rccs = quotemeta $ccs;
+my $rcce = quotemeta $cce;
+
eval {
require Getopt::Long;
Getopt::Long::GetOptions(\%opt, qw(
@@ -409,12 +430,6 @@
$opt{'compat-version'} = 5;
}

-# Never use C comments in this file!!!!!
-my $ccs = '/'.'*';
-my $cce = '*'.'/';
-my $rccs = quotemeta $ccs;
-my $rcce = quotemeta $cce;
-
my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
? ( $1 => {
($2 ? ( base => $2 ) : ()),
@@ -473,6 +488,7 @@
HeSVKEY_force||5.004000|
HeSVKEY_set||5.004000|
HeSVKEY||5.004000|
+HeUTF8||5.011000|
HeVAL||5.004000|
HvNAME|||
INT2PTR|5.006000||p
@@ -492,7 +508,7 @@
LEAVE|||
LVRET|||
MARK|||
-MULTICALL||5.009005|
+MULTICALL||5.011000|
MY_CXT_CLONE|5.009002||p
MY_CXT_INIT|5.007003||p
MY_CXT|5.007003||p
@@ -530,8 +546,9 @@
PAD_SVl|||
PAD_SV|||
PERL_ABS|5.008001||p
-PERL_BCDVERSION|5.009005||p
+PERL_BCDVERSION|5.011000||p
PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
+PERL_HASH|5.004000||p
PERL_INT_MAX|5.004000||p
PERL_INT_MIN|5.004000||p
PERL_LONG_MAX|5.004000||p
@@ -547,10 +564,10 @@
PERL_MAGIC_env|5.007002||p
PERL_MAGIC_ext|5.007002||p
PERL_MAGIC_fm|5.007002||p
-PERL_MAGIC_glob|5.009005||p
+PERL_MAGIC_glob|5.011000||p
PERL_MAGIC_isaelem|5.007002||p
PERL_MAGIC_isa|5.007002||p
-PERL_MAGIC_mutex|5.007002||p
+PERL_MAGIC_mutex|5.011000||p
PERL_MAGIC_nkeys|5.007002||p
PERL_MAGIC_overload_elem|5.007002||p
PERL_MAGIC_overload_table|5.007002||p
@@ -608,7 +625,7 @@
PL_DBtrace|||pn
PL_Sv|5.005000||p
PL_compiling|5.004050||p
-PL_copline|5.005000||p
+PL_copline|5.011000||p
PL_curcop|5.004050||p
PL_curstash|5.004050||p
PL_debstash|5.004050||p
@@ -617,6 +634,7 @@
PL_dirty|5.004050||p
PL_dowarn|||pn
PL_errgv|5.004050||p
+PL_expect|5.011000||p
PL_hexdigit|5.005000||p
PL_hints|5.005000||p
PL_last_in_gv|||n
@@ -642,7 +660,7 @@
PL_sv_yes|5.004050||pn
PL_tainted|5.004050||p
PL_tainting|5.004050||p
-POP_MULTICALL||5.009005|
+POP_MULTICALL||5.011000|
POPi|||n
POPl|||n
POPn|||n
@@ -656,7 +674,7 @@
PTR2ul|5.007001||p
PTRV|5.006000||p
PUSHMARK|||
-PUSH_MULTICALL||5.009005|
+PUSH_MULTICALL||5.011000|
PUSHi|||
PUSHmortal|5.009002||p
PUSHn|||
@@ -687,8 +705,7 @@
PerlIO_tell||5.007003|
PerlIO_unread||5.007003|
PerlIO_write||5.007003|
-Perl_warner_nocontext|5.006000||p
-Perl_warner|5.006000||p
+Perl_signbit||5.009005|n
PoisonFree|5.009004||p
PoisonNew|5.009004||p
PoisonWith|5.009004||p
@@ -709,6 +726,17 @@
STMT_START|||p
STR_WITH_LEN|5.009003||p
ST|||
+SV_CONST_RETURN|5.009003||p
+SV_COW_DROP_PV|5.008001||p
+SV_COW_SHARED_HASH_KEYS|5.009005||p
+SV_GMAGIC|5.007002||p
+SV_HAS_TRAILING_NUL|5.009004||p
+SV_IMMEDIATE_UNREF|5.007001||p
+SV_MUTABLE_RETURN|5.009003||p
+SV_NOSTEAL|5.009002||p
+SV_SMAGIC|5.009003||p
+SV_UTF8_NO_ENCODING|5.008001||p
+SVf_UTF8|5.006000||p
SVf|5.006000||p
SVt_IV|||
SVt_NV|||
@@ -720,6 +748,7 @@
Safefree|||
Slab_Alloc|||
Slab_Free|||
+Slab_to_rw|||
StructCopy|||
SvCUR_set|||
SvCUR|||
@@ -769,9 +798,24 @@
SvPVX_const|5.009003||p
SvPVX_mutable|5.009003||p
SvPVX|||
+SvPV_const|5.009003||p
+SvPV_flags_const_nolen|5.009003||p
+SvPV_flags_const|5.009003||p
+SvPV_flags_mutable|5.009003||p
+SvPV_flags|5.007002||p
+SvPV_force_flags_mutable|5.009003||p
+SvPV_force_flags_nolen|5.009003||p
+SvPV_force_flags|5.007002||p
+SvPV_force_mutable|5.009003||p
+SvPV_force_nolen|5.009003||p
+SvPV_force_nomg_nolen|5.009003||p
SvPV_force_nomg|5.007002||p
-SvPV_force|||
+SvPV_force|||p
+SvPV_mutable|5.009003||p
+SvPV_nolen_const|5.009003||p
SvPV_nolen|5.006000||p
+SvPV_nomg_const_nolen|5.009003||p
+SvPV_nomg_const|5.009003||p
SvPV_nomg|5.007002||p
SvPV_set|||
SvPVbyte_force||5.009002|
@@ -801,7 +845,10 @@
SvROK|||
SvRV_set|5.009003||p
SvRV|||
+SvRXOK||5.009005|
+SvRX||5.009005|
SvSETMAGIC|||
+SvSHARED_HASH|5.009003||p
SvSHARE||5.007003|
SvSTASH_set|5.009003||p
SvSTASH|||
@@ -816,7 +863,7 @@
SvTRUE|||
SvTYPE|||
SvUNLOCK||5.007003|
-SvUOK||5.007001|
+SvUOK|5.007001|5.006000|p
SvUPGRADE|||
SvUTF8_off||5.006000|
SvUTF8_on||5.006000|
@@ -831,6 +878,7 @@
SvVSTRING_mg|5.009004||p
THIS|||n
UNDERBAR|5.009002||p
+UTF8_MAXBYTES|5.009002||p
UVSIZE|5.006000||p
UVTYPE|5.006000||p
UVXf|5.007001||p
@@ -839,7 +887,7 @@
UVxf|5.006000||p
WARN_ALL|5.006000||p
WARN_AMBIGUOUS|5.006000||p
-WARN_ASSERTIONS|5.009000||p
+WARN_ASSERTIONS|5.011000||p
WARN_BAREWORD|5.006000||p
WARN_CLOSED|5.006000||p
WARN_CLOSURE|5.006000||p
@@ -920,8 +968,8 @@
_pMY_CXT|5.007003||p
aMY_CXT_|5.007003||p
aMY_CXT|5.007003||p
-aTHXR_|||p
-aTHXR|||p
+aTHXR_|5.011000||p
+aTHXR|5.011000||p
aTHX_|5.006000||p
aTHX|5.006000||p
add_data|||n
@@ -945,12 +993,15 @@
atfork_unlock||5.007003|n
av_arylen_p||5.009003|
av_clear|||
+av_create_and_push||5.009005|
+av_create_and_unshift_one||5.009005|
av_delete||5.006000|
av_exists||5.006000|
av_extend|||
av_fake|||
av_fetch|||
av_fill|||
+av_iter_p||5.011000|
av_len|||
av_make|||
av_pop|||
@@ -969,6 +1020,7 @@
boolSV|5.004000||p
boot_core_PerlIO|||
boot_core_UNIVERSAL|||
+boot_core_mro|||
boot_core_xsutils|||
bytes_from_utf8||5.007001|
bytes_to_uni|||n
@@ -996,6 +1048,7 @@
ck_defined|||
ck_delete|||
ck_die|||
+ck_each|||
ck_eof|||
ck_eval|||
ck_exec|||
@@ -1014,6 +1067,7 @@
ck_method|||
ck_null|||
ck_open|||
+ck_readline|||
ck_repeat|||
ck_require|||
ck_retarget|||
@@ -1071,7 +1125,7 @@
dORIGMARK|||
dSP|||
dTHR|5.004050||p
-dTHXR|||p
+dTHXR|5.011000||p
dTHXa|5.006000||p
dTHXoa|5.006000||p
dTHX|5.006000||p
@@ -1133,7 +1187,6 @@
do_open9||5.006000|
do_openn||5.007001|
do_open||5.004000|
-do_pipe|||
do_pmop_dump||5.006000|
do_pmop_xmldump|||
do_print|||
@@ -1158,7 +1211,6 @@
do_vecget|||
do_vecset|||
do_vop|||
-docatch_body|||
docatch|||
doeval|||
dofile|||
@@ -1173,7 +1225,6 @@
dopoptolabel|||
dopoptoloop|||
dopoptosub_at|||
-dopoptosub|||
dopoptowhen|||
doref||5.009003|
dounwind|||
@@ -1194,7 +1245,7 @@
dump_vindent||5.006000|
dumpuntil|||
dup_attrlist|||
-emulate_eaccess|||
+emulate_cop_io|||
eval_pv|5.006000||p
eval_sv|5.006000||p
exec_failed|||
@@ -1207,12 +1258,13 @@
filter_del|||
filter_gets|||
filter_read|||
+find_and_forget_pmops|||
find_array_subscript|||
find_beginning|||
find_byclass|||
find_hash_subscript|||
find_in_my_stash|||
-find_runcv|||
+find_runcv||5.008001|
find_rundefsvoffset||5.009002|
find_script|||
find_uninit_var|||
@@ -1224,6 +1276,7 @@
force_next|||
force_version|||
force_word|||
+forget_pmop|||
form_nocontext|||vn
form||5.004000|v
fp_dup|||
@@ -1233,8 +1286,10 @@
free_tmps|||
gen_constant_list|||
get_arena|||
+get_aux_mg|||
get_av|5.006000||p
get_context||5.006000|n
+get_cvn_flags||5.009005|
get_cv|5.006000||p
get_db_sub|||
get_debug_opts|||
@@ -1247,6 +1302,7 @@
get_op_names||5.005000|
get_opargs|||
get_ppaddr||5.006000|
+get_re_arg|||
get_sv|5.006000||p
get_vtbl||5.005030|
getcwd_sv||5.007002|
@@ -1276,6 +1332,7 @@
gv_efullname4||5.006001|
gv_efullname|||
gv_ename|||
+gv_fetchfile_flags||5.009005|
gv_fetchfile|||
gv_fetchmeth_autoload||5.007003|
gv_fetchmethod_autoload||5.004000|
@@ -1287,6 +1344,7 @@
gv_fullname3||5.004000|
gv_fullname4||5.006001|
gv_fullname|||
+gv_get_super_pkg|||
gv_handler||5.007001|
gv_init_sv|||
gv_init|||
@@ -1299,11 +1357,13 @@
hek_dup|||
hfreeentries|||
hsplit|||
-hv_assert||5.009005|
+hv_assert||5.011000|
hv_auxinit|||n
hv_backreferences_p|||
hv_clear_placeholders||5.009001|
hv_clear|||
+hv_common_key_len||5.010000|
+hv_common||5.010000|
hv_copy_hints_hv|||
hv_delayfree_ent||5.004000|
hv_delete_common|||
@@ -1313,7 +1373,6 @@
hv_eiter_set||5.009003|
hv_exists_ent||5.004000|
hv_exists|||
-hv_fetch_common|||
hv_fetch_ent||5.004000|
hv_fetchs|5.009003||p
hv_fetch|||
@@ -1328,7 +1387,6 @@
hv_kill_backrefs|||
hv_ksplit||5.004000|
hv_magic_check|||n
-hv_magic_uvar_xkey|||
hv_magic|||
hv_name_set||5.009003|
hv_notallowed|||
@@ -1346,7 +1404,6 @@
ibcmp_locale||5.004000|
ibcmp_utf8||5.007003|
ibcmp|||
-incl_perldb|||
incline|||
incpush_if_exists|||
incpush|||
@@ -1358,7 +1415,6 @@
init_i18nl14n||5.006000|
init_ids|||
init_interp|||
-init_lexer|||
init_main_stash|||
init_perllib|||
init_postdump_symbols|||
@@ -1446,7 +1502,7 @@
listkids|||
list|||
load_module_nocontext|||vn
-load_module||5.006000|v
+load_module|5.006000||pv
localize|||
looks_like_bool|||
looks_like_number|||
@@ -1454,10 +1510,12 @@
mPUSHi|5.009002||p
mPUSHn|5.009002||p
mPUSHp|5.009002||p
+mPUSHs|5.011000||p
mPUSHu|5.009002||p
mXPUSHi|5.009002||p
mXPUSHn|5.009002||p
mXPUSHp|5.009002||p
+mXPUSHs|5.011000||p
mXPUSHu|5.009002||p
mad_free|||
madlex|||
@@ -1471,7 +1529,6 @@
magic_existspack|||
magic_freearylen_p|||
magic_freeovrld|||
-magic_freeregexp|||
magic_getarylen|||
magic_getdefelem|||
magic_getnkeys|||
@@ -1495,13 +1552,10 @@
magic_set_all_env|||
magic_setamagic|||
magic_setarylen|||
-magic_setbm|||
magic_setcollxfrm|||
magic_setdbline|||
magic_setdefelem|||
magic_setenv|||
-magic_setfm|||
-magic_setglob|||
magic_sethint|||
magic_setisa|||
magic_setmglob|||
@@ -1554,6 +1608,13 @@
more_bodies|||
more_sv|||
moreswitches|||
+mro_get_linear_isa_c3|||
+mro_get_linear_isa_dfs|||
+mro_get_linear_isa||5.009005|
+mro_isa_changed_in|||
+mro_meta_dup|||
+mro_meta_init|||
+mro_method_changed_in||5.009005|
mul128|||
mulexp10|||n
my_atof2||5.007002|
@@ -1569,7 +1630,9 @@
my_bzero|||n
my_chsize|||
my_clearenv|||
+my_cxt_index|||
my_cxt_init|||
+my_dirfd||5.009005|
my_exit_jump|||
my_exit|||
my_failure_exit||5.004000|
@@ -1650,7 +1713,7 @@
newMYSUB|||
newNULLLIST|||
newOP|||
-newPADOP||5.006000|
+newPADOP|||
newPMOP|||
newPROG|||
newPVOP|||
@@ -1663,13 +1726,17 @@
newSUB|||
newSVOP|||
newSVREF|||
+newSV_type||5.009005|
newSVhek||5.009003|
newSViv|||
newSVnv|||
newSVpvf_nocontext|||vn
newSVpvf||5.004000|v
-newSVpvn_share||5.007001|
+newSVpvn_flags|5.011000||p
+newSVpvn_share|5.007001||p
+newSVpvn_utf8|5.011000||p
newSVpvn|5.004050||p
+newSVpvs_flags|5.011000||p
newSVpvs_share||5.009003|
newSVpvs|5.009003||p
newSVpv|||
@@ -1715,6 +1782,8 @@
op_getmad_weak|||
op_getmad|||
op_null||5.007002|
+op_refcnt_dec|||
+op_refcnt_inc|||
op_refcnt_lock||5.009002|
op_refcnt_unlock||5.009002|
op_xmldump|||
@@ -1744,15 +1813,17 @@
pad_push|||
pad_reset|||
pad_setsv|||
-pad_sv||5.009005|
+pad_sv||5.011000|
pad_swipe|||
pad_tidy|||
pad_undef|||
parse_body|||
parse_unicode_opts|||
+parser_dup|||
+parser_free|||
path_is_absolute|||n
peep|||
-pending_ident|||
+pending_Slabs_to_ro|||
perl_alloc_using|||n
perl_alloc|||n
perl_clone_using|||n
@@ -1770,20 +1841,22 @@
pmruntime|||
pmtrans|||
pop_scope|||
-pregcomp|||
+pregcomp||5.009005|
pregexec|||
+pregfree2||5.011000|
pregfree|||
prepend_elem|||
prepend_madprops|||
printbuf|||
printf_nocontext|||vn
-ptr_table_clear|||
-ptr_table_fetch|||
+process_special_blocks|||
+ptr_table_clear||5.009005|
+ptr_table_fetch||5.009005|
ptr_table_find|||n
-ptr_table_free|||
-ptr_table_new|||
-ptr_table_split|||
-ptr_table_store|||
+ptr_table_free||5.009005|
+ptr_table_new||5.009005|
+ptr_table_split||5.009005|
+ptr_table_store||5.009005|
push_scope|||
put_byte|||
pv_display||5.006000|
@@ -1792,9 +1865,10 @@
pv_uni_display||5.007003|
qerror|||
qsortsvu|||
+re_compile||5.009005|
re_croak2|||
-re_dup|||
-re_intuit_start||5.006000|
+re_dup_guts|||
+re_intuit_start||5.009005|
re_intuit_string||5.006000|
readpipe_override|||
realloc||5.007002|n
@@ -1810,14 +1884,27 @@
refcounted_he_value|||
refkids|||
refto|||
-ref||5.009003|
+ref||5.011000|
reg_check_named_buff_matched|||
-reg_named_buff_sv|||
+reg_named_buff_all||5.009005|
+reg_named_buff_exists||5.009005|
+reg_named_buff_fetch||5.009005|
+reg_named_buff_firstkey||5.009005|
+reg_named_buff_iter|||
+reg_named_buff_nextkey||5.009005|
+reg_named_buff_scalar||5.009005|
+reg_named_buff|||
reg_namedseq|||
reg_node|||
+reg_numbered_buff_fetch|||
+reg_numbered_buff_length|||
+reg_numbered_buff_store|||
+reg_qr_package|||
reg_recode|||
reg_scan_name|||
-reg_stringify|||
+reg_skipcomment|||
+reg_stringify||5.009005|
+reg_temp_copy|||
reganode|||
regatom|||
regbranch|||
@@ -1826,9 +1913,11 @@
regcppop|||
regcppush|||
regcurly|||n
+regdump_extflags|||
regdump||5.005000|
-regdupe|||
+regdupe_internal|||
regexec_flags||5.005000|
+regfree_internal||5.009005|
reghop3|||n
reghop4|||n
reghopmaybe3|||n
@@ -1850,8 +1939,8 @@
repeatcpy|||
report_evil_fh|||
report_uninit|||
-require_errno|||
require_pv||5.006000|
+require_tie_mod|||
restore_magic|||
rninstr|||
rsignal_restore|||
@@ -1892,7 +1981,6 @@
save_hash|||
save_hek_flags|||n
save_helem||5.004050|
-save_hints||5.005000|
save_hptr|||
save_int|||
save_item|||
@@ -1917,6 +2005,7 @@
savepvn|||
savepvs||5.009003|
savepv|||
+savesharedpvn||5.009005|
savesharedpv||5.007003|
savestack_grow_cnt||5.008001|
savestack_grow|||
@@ -1943,7 +2032,7 @@
scan_subst|||
scan_trans|||
scan_version||5.009001|
-scan_vstring||5.008001|
+scan_vstring||5.009005|
scan_word|||
scope|||
screaminstr||5.005000|
@@ -1952,7 +2041,6 @@
sequence_tail|||
sequence|||
set_context||5.006000|n
-set_csh|||
set_numeric_local||5.006000|
set_numeric_radix||5.006000|
set_numeric_standard||5.006000|
@@ -1967,6 +2055,7 @@
skipspace1|||
skipspace2|||
skipspace|||
+softref2xv|||
sortcv_stacked|||
sortcv_xsub|||
sortcv|||
@@ -1978,7 +2067,7 @@
start_force|||
start_glob|||
start_subparse||5.004000|
-stashpv_hvname_match||5.009005|
+stashpv_hvname_match||5.011000|
stdize_locale|||
strEQ|||
strGE|||
@@ -2003,10 +2092,11 @@
sv_2iv_flags||5.009001|
sv_2iv|||
sv_2mortal|||
+sv_2num|||
sv_2nv|||
-sv_2pv_flags||5.007002|
+sv_2pv_flags|5.007002||p
sv_2pv_nolen|5.006000||p
-sv_2pvbyte_nolen|||
+sv_2pvbyte_nolen|5.006000||p
sv_2pvbyte|5.006000||p
sv_2pvutf8_nolen||5.006000|
sv_2pvutf8||5.006000|
@@ -2047,6 +2137,7 @@
sv_dec|||
sv_del_backref|||
sv_derived_from||5.004000|
+sv_destroyable||5.010000|
sv_does||5.009004|
sv_dump|||
sv_dup|||
@@ -2068,6 +2159,7 @@
sv_kill_backrefs|||
sv_len_utf8||5.006000|
sv_len|||
+sv_magic_portable|5.011000|5.004000|p
sv_magicext||5.007003|
sv_magic|||
sv_mortalcopy|||
@@ -2088,10 +2180,10 @@
sv_pvbyten_force||5.006000|
sv_pvbyten||5.006000|
sv_pvbyte||5.006000|
-sv_pvn_force_flags||5.007002|
-sv_pvn_force|||p
-sv_pvn_nomg|5.007003||p
-sv_pvn|5.005000||p
+sv_pvn_force_flags|5.007002||p
+sv_pvn_force|||
+sv_pvn_nomg|5.007003|5.005000|p
+sv_pvn||5.005000|
sv_pvutf8n_force||5.006000|
sv_pvutf8n||5.006000|
sv_pvutf8||5.006000|
@@ -2099,7 +2191,6 @@
sv_recode_to_utf8||5.007003|
sv_reftype|||
sv_release_COW|||
-sv_release_IVX|||
sv_replace|||
sv_report_used|||
sv_reset|||
@@ -2159,12 +2250,16 @@
sv_xmlpeek|||
svtype|||
swallow_bom|||
+swap_match_buff|||
swash_fetch||5.007002|
swash_get|||
swash_init||5.006000|
+sys_init3||5.010000|n
+sys_init||5.010000|n
sys_intern_clear|||
sys_intern_dup|||
sys_intern_init|||
+sys_term||5.010000|n
taint_env|||
taint_proper|||
tmps_grow||5.006000|
@@ -2200,7 +2295,8 @@
unshare_hek|||
unsharepvn||5.004000|
unwind_handler_stack|||
-upg_version||5.009000|
+update_debugger_info|||
+upg_version||5.009005|
usage|||
utf16_to_utf8_reversed||5.006001|
utf16_to_utf8||5.006001|
@@ -2230,7 +2326,7 @@
visit|||
vivify_defelem|||
vivify_ref|||
-vload_module||5.006000|
+vload_module|5.006000||p
vmess||5.006000|
vnewSVpvf|5.006000|5.004000|p
vnormal||5.009002|
@@ -2273,22 +2369,65 @@

# Scan for possible replacement candidates

-my(%replace, %need, %hints, %depends);
+my(%replace, %need, %hints, %warnings, %depends);
my $replace = 0;
-my $hint = '';
+my($hint, $define, $function);

+sub find_api
+{
+ my $code = shift;
+ $code =~ s{
+ / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
+ | "[^"\\]*(?:\\.[^"\\]*)*"
+ | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
+ grep { exists $API{$_} } $code =~ /(\w+)/mg;
+}
+
while (<DATA>) {
if ($hint) {
+ my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
if (m{^\s*\*\s(.*?)\s*$}) {
- $hints{$hint} ||= ''; # suppress warning with older perls
- $hints{$hint} .= "$1\n";
+ for (@{$hint->[1]}) {
+ $h->{$_} ||= ''; # suppress warning with older perls
+ $h->{$_} .= "$1\n";
+ }
}
+ else { undef $hint }
+ }
+
+ $hint = [$1, [split /,?\s+/, $2]]
+ if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
+
+ if ($define) {
+ if ($define->[1] =~ /\\$/) {
+ $define->[1] .= $_;
+ }
else {
- $hint = '';
+ if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
+ my @n = find_api($define->[1]);
+ push @{$depends{$define->[0]}}, @n if @n
+ }
+ undef $define;
}
}
- $hint = $1 if m{^\s*$rccs\sHint:\s+(\w+)\s*$};

+ $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
+
+ if ($function) {
+ if (/^}/) {
+ if (exists $API{$function->[0]}) {
+ my @n = find_api($function->[1]);
+ push @{$depends{$function->[0]}}, @n if @n
+ }
+ undef $function;
+ }
+ else {
+ $function->[1] .= $_;
+ }
+ }
+
+ $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
+
$replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
$replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
$replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
@@ -2301,6 +2440,11 @@
$need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
}

+for (values %depends) {
+ my %s;
+ $_ = [sort grep !$s{$_}++, @$_];
+}
+
if (exists $opt{'api-info'}) {
my $f;
my $count = 0;
@@ -2319,20 +2463,15 @@
print "Support by $ppport provided back to perl-$todo.\n";
print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
- print "$hints{$f}" if exists $hints{$f};
+ print "\n$hints{$f}" if exists $hints{$f};
+ print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
$info++;
}
- unless ($info) {
- print "No portability information available.\n";
- }
+ print "No portability information available.\n" unless $info;
$count++;
}
- if ($count > 0) {
- print "\n";
- }
- else {
- print "Found no API matching '$opt{'api-info'}'.\n";
- }
+ $count or print "Found no API matching '$opt{'api-info'}'.";
+ print "\n";
exit 0;
}

@@ -2344,6 +2483,7 @@
push @flags, 'explicit' if exists $need{$f};
push @flags, 'depend' if exists $depends{$f};
push @flags, 'hint' if exists $hints{$f};
+ push @flags, 'warning' if exists $warnings{$f};
my $flags = @flags ? ' ['.join(', ', @flags).']' : '';
print "$f$flags\n";
}
@@ -2351,23 +2491,35 @@
}

my @files;
-my @srcext = qw( xs c h cc cpp );
-my $srcext = join '|', @srcext;
+my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
+my $srcext = join '|', map { quotemeta $_ } @srcext;

if (@ARGV) {
my %seen;
- @files = grep { -f && !exists $seen{$_} } map { glob $_ } @ARGV;
+ for (@ARGV) {
+ if (-e) {
+ if (-f) {
+ push @files, $_ unless $seen{$_}++;
+ }
+ else { warn "'$_' is not a file.\n" }
+ }
+ else {
+ my @new = grep { -f } glob $_
+ or warn "'$_' does not exist.\n";
+ push @files, grep { !$seen{$_}++ } @new;
+ }
+ }
}
else {
eval {
require File::Find;
File::Find::find(sub {
- $File::Find::name =~ /\.($srcext)$/i
+ $File::Find::name =~ /($srcext)$/i
and push @files, $File::Find::name;
}, '.');
};
if ($@) {
- @files = map { glob "*.$_" } @srcext;
+ @files = map { glob "*$_" } @srcext;
}
}

@@ -2375,7 +2527,7 @@
my(@in, @out);
my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
for (@files) {
- my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/\.($srcext)$/i;
+ my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
push @{ $out ? \@out : \@in }, $_;
}
if (@ARGV && @out) {
@@ -2384,9 +2536,7 @@
@files = @in;
}

-unless (@files) {
- die "No input files given!\n";
-}
+die "No input files given!\n" unless @files;

my(%files, %global, %revreplace);
%revreplace = reverse %replace;
@@ -2406,30 +2556,22 @@

my %file = (orig => $c, changes => 0);

- # temporarily remove C comments from the code
+ # Temporarily remove C/XS comments and strings from the code
my @ccom;
+
$c =~ s{
- (
- [^"'/]+
- |
- (?:"[^"\\]*(?:\\.[^"\\]*)*" [^"'/]*)+
- |
- (?:'[^'\\]*(?:\\.[^'\\]*)*' [^"'/]*)+
- )
- |
- (/ (?:
- \*[^*]*\*+(?:[^$ccs][^*]*\*+)* /
- |
- /[^\r\n]*
- ))
- }{
- defined $2 and push @ccom, $2;
- defined $1 ? $1 : "$ccs$#ccom$cce";
- }egsx;
+ ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
+ | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
+ | ( ^$HS*\#[^\r\n]*
+ | "[^"\\]*(?:\\.[^"\\]*)*"
+ | '[^'\\]*(?:\\.[^'\\]*)*'
+ | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
+ }{ defined $2 and push @ccom, $2;
+ defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;

$file{ccom} = \@ccom;
$file{code} = $c;
- $file{has_inc_ppport} = ($c =~ /#.*include.*\Q$ppport\E/);
+ $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;

my $func;

@@ -2440,6 +2582,7 @@
$file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
$file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
if (exists $API{$func}{provided}) {
+ $file{uses_provided}{$func}++;
if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
$file{uses}{$func}++;
my @deps = rec_depend($func);
@@ -2450,9 +2593,7 @@
}
}
for ($func, @deps) {
- if (exists $need{$_}) {
- $file{needs}{$_} = 'static';
- }
+ $file{needs}{$_} = 'static' if exists $need{$_};
}
}
}
@@ -2468,9 +2609,7 @@
if (exists $need{$2}) {
$file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
}
- else {
- warning("Possibly wrong #define $1 in $filename");
- }
+ else { warning("Possibly wrong #define $1 in $filename") }
}

for (qw(uses needs uses_todo needed_global needed_static)) {
@@ -2507,14 +2646,17 @@
my %file = %{$files{$filename}};
my $func;
my $c = $file{code};
+ my $warnings = 0;

for $func (sort keys %{$file{uses_Perl}}) {
if ($API{$func}{varargs}) {
- my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
- { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
- if ($changes) {
- warning("Doesn't pass interpreter argument aTHX to Perl_$func");
- $file{changes} += $changes;
+ unless ($API{$func}{nothxarg}) {
+ my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
+ { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
+ if ($changes) {
+ warning("Doesn't pass interpreter argument aTHX to Perl_$func");
+ $file{changes} += $changes;
+ }
}
}
else {
@@ -2529,24 +2671,24 @@
$file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
}

- for $func (sort keys %{$file{uses}}) {
- next unless $file{uses}{$func}; # if it's only a dependency
- if (exists $file{uses_deps}{$func}) {
- diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
+ for $func (sort keys %{$file{uses_provided}}) {
+ if ($file{uses}{$func}) {
+ if (exists $file{uses_deps}{$func}) {
+ diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
+ }
+ else {
+ diag("Uses $func");
+ }
}
- elsif (exists $replace{$func}) {
- warning("Uses $func instead of $replace{$func}");
- $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
- }
- else {
- diag("Uses $func");
- }
- hint($func);
+ $warnings += hint($func);
}

- for $func (sort keys %{$file{uses_todo}}) {
- warning("Uses $func, which may not be portable below perl ",
- format_version($API{$func}{todo}));
+ unless ($opt{quiet}) {
+ for $func (sort keys %{$file{uses_todo}}) {
+ print "*** WARNING: Uses $func, which may not be portable below perl ",
+ format_version($API{$func}{todo}), ", even with '$ppport'\n";
+ $warnings++;
+ }
}

for $func (sort keys %{$file{needed_static}}) {
@@ -2645,6 +2787,10 @@
warning("Uses $cppc C++ style comment$s, which is not portable");
}

+ my $s = $warnings != 1 ? 's' : '';
+ my $warn = $warnings ? " ($warnings warning$s)" : '';
+ info("Analysis completed$warn");
+
if ($file{changes}) {
if (exists $opt{copy}) {
my $newfile = "$filename$opt{copy}";
@@ -2699,6 +2845,8 @@
exit 0;


+sub try_use { eval "use @_;"; return $@ eq '' }
+
sub mydiff
{
local *F = shift;
@@ -2709,7 +2857,7 @@
$diff = run_diff($opt{diff}, $file, $str);
}

- if (!defined $diff and can_use('Text::Diff')) {
+ if (!defined $diff and try_use('Text::Diff')) {
$diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
$diff = <<HEADER . $diff;
--- $file
@@ -2731,7 +2879,6 @@
}

print F $diff;
-
}

sub run_diff
@@ -2768,18 +2915,14 @@
return undef;
}

-sub can_use
-{
- eval "use @_;";
- return $@ eq '';
-}
-
sub rec_depend
{
- my $func = shift;
- my %seen;
+ my($func, $seen) = @_;
return () unless exists $depends{$func};
- grep !$seen{$_}++, map { ($_, rec_depend($_)) } @{$depends{$func}};
+ $seen = {%{$seen||{}}};
+ return () if $seen->{$func}++;
+ my %s;
+ grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
}

sub parse_version
@@ -2859,16 +3002,24 @@
}

my %given_hints;
+my %given_warnings;
sub hint
{
$opt{quiet} and return;
- $opt{hints} or return;
my $func = shift;
- exists $hints{$func} or return;
- $given_hints{$func}++ and return;
- my $hint = $hints{$func};
- $hint =~ s/^/ /mg;
- print " --- hint for $func ---\n", $hint;
+ my $rv = 0;
+ if (exists $warnings{$func} && !$given_warnings{$func}++) {
+ my $warn = $warnings{$func};
+ $warn =~ s!^!*** !mg;
+ print "*** WARNING: $func\n", $warn;
+ $rv++;
+ }
+ if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
+ my $hint = $hints{$func};
+ $hint =~ s/^/ /mg;
+ print " --- hint for $func ---\n", $hint;
+ }
+ $rv;
}

sub usage
@@ -2918,9 +3069,19 @@

END
/ms;
+ my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
+ $c =~ s{
+ / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
+ | ( "[^"\\]*(?:\\.[^"\\]*)*"
+ | '[^'\\]*(?:\\.[^'\\]*)*' )
+ | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
+ $c =~ s!\s+$!!mg;
+ $c =~ s!^$LF!!mg;
+ $c =~ s!^\s*#\s*!#!mg;
+ $c =~ s!^\s+!!mg;

open OUT, ">$0" or die "cannot strip $0: $!\n";
- print OUT $self;
+ print OUT "$pl$c\n";

exit 0;
}
@@ -2956,7 +3117,8 @@
# endif
#endif

-#define PERL_BCDVERSION ((PERL_REVISION * 0x1000000L) + (PERL_VERSION * 0x1000L) + PERL_SUBVERSION)
+#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
+#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))

/* It is very unlikely that anyone will try to use this with Perl 6
(or greater), but who knows.
@@ -3341,6 +3503,10 @@
#ifndef sv_uv
# define sv_uv(sv) SvUVx(sv)
#endif
+
+#if !defined(SvUOK) && defined(SvIOK_UV)
+# define SvUOK(sv) SvIOK_UV(sv)
+#endif
#ifndef XST_mUV
# define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
#endif
@@ -3556,11 +3722,6 @@
#ifndef ERRSV
# define ERRSV get_sv("@",FALSE)
#endif
-#ifndef newSVpvn
-# define newSVpvn(data,len) ((data) \
- ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
- : newSV(0))
-#endif

/* Hint: gv_stashpvn
* This function's backport doesn't support the length parameter, but
@@ -3615,7 +3776,7 @@
# define XSprePUSH (sp = PL_stack_base + ax - 1)
#endif

-#if ((PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION < 0)))
+#if (PERL_BCDVERSION < 0x5005000)
# undef XSRETURN
# define XSRETURN(off) \
STMT_START { \
@@ -3632,12 +3793,26 @@
#ifndef SVf
# define SVf "_"
#endif
+#ifndef UTF8_MAXBYTES
+# define UTF8_MAXBYTES UTF8_MAXLEN
+#endif
+#ifndef PERL_HASH
+# define PERL_HASH(hash,str,len) \
+ STMT_START { \
+ const char *s_PeRlHaSh = str; \
+ I32 i_PeRlHaSh = len; \
+ U32 hash_PeRlHaSh = 0; \
+ while (i_PeRlHaSh--) \
+ hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
+ (hash) = hash_PeRlHaSh; \
+ } STMT_END
+#endif

#ifndef PERL_SIGNALS_UNSAFE_FLAG

#define PERL_SIGNALS_UNSAFE_FLAG 0x0001

-#if ((PERL_VERSION < 8) || ((PERL_VERSION == 8) && (PERL_SUBVERSION < 0)))
+#if (PERL_BCDVERSION < 0x5008000)
# define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
#else
# define D_PPP_PERL_SIGNALS_INIT 0
@@ -3661,14 +3836,14 @@
* automatically be defined as the correct argument.
*/

-#if ((PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION <= 4)))
+#if (PERL_BCDVERSION <= 0x5005005)
/* Replace: 1 */
# define PL_ppaddr ppaddr
# define PL_no_modify no_modify
/* Replace: 0 */
#endif

-#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
+#if (PERL_BCDVERSION <= 0x5004005)
/* Replace: 1 */
# define PL_DBsignal DBsignal
# define PL_DBsingle DBsingle
@@ -3685,6 +3860,7 @@
# define PL_dirty dirty
# define PL_dowarn dowarn
# define PL_errgv errgv
+# define PL_expect expect
# define PL_hexdigit hexdigit
# define PL_hints hints
# define PL_laststatval laststatval
@@ -3705,6 +3881,20 @@
# define PL_tainting tainting
/* Replace: 0 */
#endif
+
+/* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters
+ * Do not use this variable. It is internal to the perl parser
+ * and may change or even be removed in the future. Note that
+ * as of perl 5.9.5 you cannot assign to this variable anymore.
+ */
+
+/* TODO: cannot assign to these vars; is it worth fixing? */
+#if (PERL_BCDVERSION >= 0x5009005)
+# define PL_expect (PL_parser ? PL_parser->expect : 0)
+# define PL_copline (PL_parser ? PL_parser->copline : 0)
+# define PL_rsfp (PL_parser ? PL_parser->rsfp : (PerlIO *) 0)
+# define PL_rsfp_filters (PL_parser ? PL_parser->rsfp_filters : (AV *) 0)
+#endif
#ifndef dTHR
# define dTHR dNOOP
#endif
@@ -3731,10 +3921,10 @@
# define aTHX_
#endif

-#if ((PERL_VERSION < 6) || ((PERL_VERSION == 6) && (PERL_SUBVERSION < 0)))
+#if (PERL_BCDVERSION < 0x5006000)
# ifdef USE_THREADS
# define aTHXR thr
-# define aTHXR_ thr,
+# define aTHXR_ thr,
# else
# define aTHXR
# define aTHXR_
@@ -3748,43 +3938,51 @@
#ifndef dTHXoa
# define dTHXoa(x) dTHXa(x)
#endif
+#ifndef mPUSHs
+# define mPUSHs(s) PUSHs(sv_2mortal(s))
+#endif
+
#ifndef PUSHmortal
# define PUSHmortal PUSHs(sv_newmortal())
#endif

#ifndef mPUSHp
-# define mPUSHp(p,l) sv_setpvn_mg(PUSHmortal, (p), (l))
+# define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
#endif

#ifndef mPUSHn
-# define mPUSHn(n) sv_setnv_mg(PUSHmortal, (NV)(n))
+# define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
#endif

#ifndef mPUSHi
-# define mPUSHi(i) sv_setiv_mg(PUSHmortal, (IV)(i))
+# define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
#endif

#ifndef mPUSHu
-# define mPUSHu(u) sv_setuv_mg(PUSHmortal, (UV)(u))
+# define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
#endif
+#ifndef mXPUSHs
+# define mXPUSHs(s) XPUSHs(sv_2mortal(s))
+#endif
+
#ifndef XPUSHmortal
# define XPUSHmortal XPUSHs(sv_newmortal())
#endif

#ifndef mXPUSHp
-# define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn_mg(PUSHmortal, (p), (l)); } STMT_END
+# define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
#endif

#ifndef mXPUSHn
-# define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv_mg(PUSHmortal, (NV)(n)); } STMT_END
+# define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
#endif

#ifndef mXPUSHi
-# define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv_mg(PUSHmortal, (IV)(i)); } STMT_END
+# define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
#endif

#ifndef mXPUSHu
-# define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv_mg(PUSHmortal, (UV)(u)); } STMT_END
+# define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
#endif

/* Replace: 1 */
@@ -3806,11 +4004,21 @@
#ifndef eval_sv
# define eval_sv perl_eval_sv
#endif
+#ifndef PERL_LOADMOD_DENY
+# define PERL_LOADMOD_DENY 0x1
+#endif

+#ifndef PERL_LOADMOD_NOIMPORT
+# define PERL_LOADMOD_NOIMPORT 0x2
+#endif
+
+#ifndef PERL_LOADMOD_IMPORT_OPS
+# define PERL_LOADMOD_IMPORT_OPS 0x4
+#endif
+
/* Replace: 0 */

/* Replace perl_eval_pv with eval_pv */
-/* eval_pv depends on eval_sv */

#ifndef eval_pv
#if defined(NEED_eval_pv)
@@ -3850,6 +4058,106 @@

#endif
#endif
+
+#ifndef vload_module
+#if defined(NEED_vload_module)
+static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
+static
+#else
+extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
+#endif
+
+#ifdef vload_module
+# undef vload_module
+#endif
+#define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
+#define Perl_vload_module DPPP_(my_vload_module)
+
+#if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
+
+void
+DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
+{
+ dTHR;
+ dVAR;
+ OP *veop, *imop;
+
+ OP * const modname = newSVOP(OP_CONST, 0, name);
+ /* 5.005 has a somewhat hacky force_normal that doesn't croak on
+ SvREADONLY() if PL_compling is true. Current perls take care in
+ ck_require() to correctly turn off SvREADONLY before calling
+ force_normal_flags(). This seems a better fix than fudging PL_compling
+ */
+ SvREADONLY_off(((SVOP*)modname)->op_sv);
+ modname->op_private |= OPpCONST_BARE;
+ if (ver) {
+ veop = newSVOP(OP_CONST, 0, ver);
+ }
+ else
+ veop = NULL;
+ if (flags & PERL_LOADMOD_NOIMPORT) {
+ imop = sawparens(newNULLLIST());
+ }
+ else if (flags & PERL_LOADMOD_IMPORT_OPS) {
+ imop = va_arg(*args, OP*);
+ }
+ else {
+ SV *sv;
+ imop = NULL;
+ sv = va_arg(*args, SV*);
+ while (sv) {
+ imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
+ sv = va_arg(*args, SV*);
+ }
+ }
+ {
+ const line_t ocopline = PL_copline;
+ COP * const ocurcop = PL_curcop;
+ const int oexpect = PL_expect;
+
+#if (PERL_BCDVERSION >= 0x5004000)
+ utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
+ veop, modname, imop);
+#else
+ utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
+ modname, imop);
+#endif
+ PL_expect = oexpect;
+ PL_copline = ocopline;
+ PL_curcop = ocurcop;
+ }
+}
+
+#endif
+#endif
+
+#ifndef load_module
+#if defined(NEED_load_module)
+static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
+static
+#else
+extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
+#endif
+
+#ifdef load_module
+# undef load_module
+#endif
+#define load_module DPPP_(my_load_module)
+#define Perl_load_module DPPP_(my_load_module)
+
+#if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
+
+void
+DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
+{
+ va_list args;
+ va_start(args, ver);
+ vload_module(flags, name, ver, &args);
+ va_end(args);
+}
+
+#endif
+#endif
#ifndef newRV_inc
# define newRV_inc(sv) newRV(sv) /* Replace */
#endif
@@ -3885,12 +4193,12 @@
*/

/* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
-#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 63))) && ((PERL_VERSION != 4) || (PERL_SUBVERSION != 5))
+#if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
#if defined(NEED_newCONSTSUB)
-static void DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv);
+static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
static
#else
-extern void DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv);
+extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
#endif

#ifdef newCONSTSUB
@@ -3902,7 +4210,7 @@
#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)

void
-DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv)
+DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
{
U32 oldhints = PL_hints;
HV *old_cop_stash = PL_curcop->cop_stash;
@@ -3916,15 +4224,15 @@

newSUB(

-#if ((PERL_VERSION < 3) || ((PERL_VERSION == 3) && (PERL_SUBVERSION < 22)))
+#if (PERL_BCDVERSION < 0x5003022)
start_subparse(),
-#elif ((PERL_VERSION == 3) && (PERL_SUBVERSION == 22))
+#elif (PERL_BCDVERSION == 0x5003022)
start_subparse(0),
#else /* 5.003_23 onwards */
start_subparse(FALSE, 0),
#endif

- newSVOP(OP_CONST, 0, newSVpv(name,0)),
+ newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
);
@@ -3966,7 +4274,7 @@
* case below uses it to declare the data as static. */
#define START_MY_CXT

-#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 68)))
+#if (PERL_BCDVERSION < 0x5004068)
/* Fetches the SV that keeps the per-interpreter data. */
#define dMY_CXT_SV \
SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
@@ -4061,7 +4369,8 @@

#ifndef NVef
# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
- defined(PERL_PRIfldbl) /* Not very likely, but let's try anyway. */
+ defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
+ /* Not very likely, but let's try anyway. */
# define NVef PERL_PRIeldbl
# define NVff PERL_PRIfldbl
# define NVgf PERL_PRIgldbl
@@ -4143,42 +4452,60 @@
#ifndef SvREFCNT_inc_simple_void_NN
# define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
#endif
+#ifndef newSVpvn
+# define newSVpvn(data,len) ((data) \
+ ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
+ : newSV(0))
+#endif
+#ifndef newSVpvn_utf8
+# define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
+#endif
+#ifndef SVf_UTF8
+# define SVf_UTF8 0
+#endif

-#ifndef SvPV_nolen
+#ifndef newSVpvn_flags

-#if defined(NEED_sv_2pv_nolen)
-static char * DPPP_(my_sv_2pv_nolen)(pTHX_ register SV *sv);
+#if defined(NEED_newSVpvn_flags)
+static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char * s, STRLEN len, U32 flags);
static
#else
-extern char * DPPP_(my_sv_2pv_nolen)(pTHX_ register SV *sv);
+extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char * s, STRLEN len, U32 flags);
#endif

-#ifdef sv_2pv_nolen
-# undef sv_2pv_nolen
+#ifdef newSVpvn_flags
+# undef newSVpvn_flags
#endif
-#define sv_2pv_nolen(a) DPPP_(my_sv_2pv_nolen)(aTHX_ a)
-#define Perl_sv_2pv_nolen DPPP_(my_sv_2pv_nolen)
+#define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
+#define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)

-#if defined(NEED_sv_2pv_nolen) || defined(NEED_sv_2pv_nolen_GLOBAL)
+#if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)

-char *
-DPPP_(my_sv_2pv_nolen)(pTHX_ register SV *sv)
+SV *
+DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
{
- STRLEN n_a;
- return sv_2pv(sv, &n_a);
+ SV *sv = newSVpvn(s, len);
+ SvFLAGS(sv) |= (flags & SVf_UTF8);
+ return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
}

#endif

+#endif
+
+/* Backwards compatibility stuff... :-( */
+#if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
+# define NEED_sv_2pv_flags
+#endif
+#if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
+# define NEED_sv_2pv_flags_GLOBAL
+#endif
+
/* Hint: sv_2pv_nolen
- * Use the SvPV_nolen() macro instead of sv_2pv_nolen().
+ * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
*/
-
-/* SvPV_nolen depends on sv_2pv_nolen */
-#define SvPV_nolen(sv) \
- ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
- ? SvPVX(sv) : sv_2pv_nolen(sv))
-
+#ifndef sv_2pv_nolen
+# define sv_2pv_nolen(sv) SvPV_nolen(sv)
#endif

#ifdef SvPVbyte
@@ -4188,13 +4515,13 @@
* borrowed from perl-5.7.3.
*/

-#if ((PERL_VERSION < 7) || ((PERL_VERSION == 7) && (PERL_SUBVERSION < 0)))
+#if (PERL_BCDVERSION < 0x5007000)

#if defined(NEED_sv_2pvbyte)
-static char * DPPP_(my_sv_2pvbyte)(pTHX_ register SV *sv, STRLEN *lp);
+static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV * sv, STRLEN * lp);
static
#else
-extern char * DPPP_(my_sv_2pvbyte)(pTHX_ register SV *sv, STRLEN *lp);
+extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV * sv, STRLEN * lp);
#endif

#ifdef sv_2pvbyte
@@ -4206,7 +4533,7 @@
#if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)

char *
-DPPP_(my_sv_2pvbyte)(pTHX_ register SV *sv, STRLEN *lp)
+DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
{
sv_utf8_downgrade(sv,0);
return SvPV(sv,*lp);
@@ -4220,7 +4547,6 @@

#undef SvPVbyte

-/* SvPVbyte depends on sv_2pvbyte */
#define SvPVbyte(sv, lp) \
((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
@@ -4233,32 +4559,209 @@
# define sv_2pvbyte sv_2pv

#endif
-
-/* sv_2pvbyte_nolen depends on sv_2pv_nolen */
#ifndef sv_2pvbyte_nolen
-# define sv_2pvbyte_nolen sv_2pv_nolen
+# define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
#endif

/* Hint: sv_pvn
* Always use the SvPV() macro instead of sv_pvn().
*/
-#ifndef sv_pvn
-# define sv_pvn(sv, len) SvPV(sv, len)
-#endif

/* Hint: sv_pvn_force
* Always use the SvPV_force() macro instead of sv_pvn_force().
*/
-#ifndef sv_pvn_force
-# define sv_pvn_force(sv, len) SvPV_force(sv, len)
+
+/* If these are undefined, they're not handled by the core anyway */
+#ifndef SV_IMMEDIATE_UNREF
+# define SV_IMMEDIATE_UNREF 0
#endif
+
+#ifndef SV_GMAGIC
+# define SV_GMAGIC 0
+#endif
+
+#ifndef SV_COW_DROP_PV
+# define SV_COW_DROP_PV 0
+#endif
+
+#ifndef SV_UTF8_NO_ENCODING
+# define SV_UTF8_NO_ENCODING 0
+#endif
+
+#ifndef SV_NOSTEAL
+# define SV_NOSTEAL 0
+#endif
+
+#ifndef SV_CONST_RETURN
+# define SV_CONST_RETURN 0
+#endif
+
+#ifndef SV_MUTABLE_RETURN
+# define SV_MUTABLE_RETURN 0
+#endif
+
+#ifndef SV_SMAGIC
+# define SV_SMAGIC 0
+#endif
+
+#ifndef SV_HAS_TRAILING_NUL
+# define SV_HAS_TRAILING_NUL 0
+#endif
+
+#ifndef SV_COW_SHARED_HASH_KEYS
+# define SV_COW_SHARED_HASH_KEYS 0
+#endif
+
+#if (PERL_BCDVERSION < 0x5007002)
+
+#if defined(NEED_sv_2pv_flags)
+static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags);
+static
+#else
+extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags);
+#endif
+
+#ifdef sv_2pv_flags
+# undef sv_2pv_flags
+#endif
+#define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
+#define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
+
+#if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
+
+char *
+DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
+{
+ STRLEN n_a = (STRLEN) flags;
+ return sv_2pv(sv, lp ? lp : &n_a);
+}
+
+#endif
+
+#if defined(NEED_sv_pvn_force_flags)
+static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags);
+static
+#else
+extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags);
+#endif
+
+#ifdef sv_pvn_force_flags
+# undef sv_pvn_force_flags
+#endif
+#define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
+#define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
+
+#if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
+
+char *
+DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
+{
+ STRLEN n_a = (STRLEN) flags;
+ return sv_pvn_force(sv, lp ? lp : &n_a);
+}
+
+#endif
+
+#endif
+
+#if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
+# define DPPP_SVPV_NOLEN_LP_ARG &PL_na
+#else
+# define DPPP_SVPV_NOLEN_LP_ARG 0
+#endif
+#ifndef SvPV_const
+# define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
+#endif
+
+#ifndef SvPV_mutable
+# define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
+#endif
+#ifndef SvPV_flags
+# define SvPV_flags(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
+#endif
+#ifndef SvPV_flags_const
+# define SvPV_flags_const(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
+ (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
+#endif
+#ifndef SvPV_flags_const_nolen
+# define SvPV_flags_const_nolen(sv, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX_const(sv) : \
+ (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
+#endif
+#ifndef SvPV_flags_mutable
+# define SvPV_flags_mutable(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
+ sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
+#endif
+#ifndef SvPV_force
+# define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
+#endif
+
+#ifndef SvPV_force_nolen
+# define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
+#endif
+
+#ifndef SvPV_force_mutable
+# define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
+#endif
+
+#ifndef SvPV_force_nomg
+# define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
+#endif
+
+#ifndef SvPV_force_nomg_nolen
+# define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
+#endif
+#ifndef SvPV_force_flags
+# define SvPV_force_flags(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
+#endif
+#ifndef SvPV_force_flags_nolen
+# define SvPV_force_flags_nolen(sv, flags) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
+ ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
+#endif
+#ifndef SvPV_force_flags_mutable
+# define SvPV_force_flags_mutable(sv, lp, flags) \
+ ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
+ ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
+ : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
+#endif
+#ifndef SvPV_nolen
+# define SvPV_nolen(sv) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
+#endif
+#ifndef SvPV_nolen_const
+# define SvPV_nolen_const(sv) \
+ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+ ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
+#endif
+#ifndef SvPV_nomg
+# define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
+#endif
+
+#ifndef SvPV_nomg_const
+# define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
+#endif
+
+#ifndef SvPV_nomg_const_nolen
+# define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
+#endif
#ifndef SvMAGIC_set
# define SvMAGIC_set(sv, val) \
STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
(((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
#endif

-#if ((PERL_VERSION < 9) || ((PERL_VERSION == 9) && (PERL_SUBVERSION < 3)))
+#if (PERL_BCDVERSION < 0x5009003)
#ifndef SvPVX_const
# define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
#endif
@@ -4293,7 +4796,7 @@
(((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
#endif

-#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 0)))
+#if (PERL_BCDVERSION < 0x5004000)
#ifndef SvUV_set
# define SvUV_set(sv, val) \
STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
@@ -4309,7 +4812,7 @@

#endif

-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(vnewSVpvf)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
#if defined(NEED_vnewSVpvf)
static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char * pat, va_list * args);
static
@@ -4336,18 +4839,15 @@
#endif
#endif

-/* sv_vcatpvf depends on sv_vcatpvfn */
-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_vcatpvf)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
# define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
#endif

-/* sv_vsetpvf depends on sv_vsetpvfn */
-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_vsetpvf)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
# define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
#endif

-/* sv_catpvf_mg depends on sv_vcatpvfn, sv_catpvf_mg_nocontext */
-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_catpvf_mg)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
#if defined(NEED_sv_catpvf_mg)
static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV * sv, const char * pat, ...);
static
@@ -4372,9 +4872,8 @@
#endif
#endif

-/* sv_catpvf_mg_nocontext depends on sv_vcatpvfn */
#ifdef PERL_IMPLICIT_CONTEXT
-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_catpvf_mg_nocontext)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
#if defined(NEED_sv_catpvf_mg_nocontext)
static void DPPP_(my_sv_catpvf_mg_nocontext)(SV * sv, const char * pat, ...);
static
@@ -4402,6 +4901,7 @@
#endif
#endif

+/* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
#ifndef sv_catpvf_mg
# ifdef PERL_IMPLICIT_CONTEXT
# define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
@@ -4410,8 +4910,7 @@
# endif
#endif

-/* sv_vcatpvf_mg depends on sv_vcatpvfn */
-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_vcatpvf_mg)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
# define sv_vcatpvf_mg(sv, pat, args) \
STMT_START { \
sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
@@ -4419,8 +4918,7 @@
} STMT_END
#endif

-/* sv_setpvf_mg depends on sv_vsetpvfn, sv_setpvf_mg_nocontext */
-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_setpvf_mg)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
#if defined(NEED_sv_setpvf_mg)
static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV * sv, const char * pat, ...);
static
@@ -4445,9 +4943,8 @@
#endif
#endif

-/* sv_setpvf_mg_nocontext depends on sv_vsetpvfn */
#ifdef PERL_IMPLICIT_CONTEXT
-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_setpvf_mg_nocontext)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
#if defined(NEED_sv_setpvf_mg_nocontext)
static void DPPP_(my_sv_setpvf_mg_nocontext)(SV * sv, const char * pat, ...);
static
@@ -4475,6 +4972,7 @@
#endif
#endif

+/* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
#ifndef sv_setpvf_mg
# ifdef PERL_IMPLICIT_CONTEXT
# define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
@@ -4483,14 +4981,53 @@
# endif
#endif

-/* sv_vsetpvf_mg depends on sv_vsetpvfn */
-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_vsetpvf_mg)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
# define sv_vsetpvf_mg(sv, pat, args) \
STMT_START { \
sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
SvSETMAGIC(sv); \
} STMT_END
#endif
+
+#ifndef newSVpvn_share
+
+#if defined(NEED_newSVpvn_share)
+static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
+static
+#else
+extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
+#endif
+
+#ifdef newSVpvn_share
+# undef newSVpvn_share
+#endif
+#define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
+#define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
+
+#if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
+
+SV *
+DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
+{
+ SV *sv;
+ if (len < 0)
+ len = -len;
+ if (!hash)
+ PERL_HASH(hash, (char*) src, len);
+ sv = newSVpvn((char *) src, len);
+ sv_upgrade(sv, SVt_PVIV);
+ SvIVX(sv) = hash;
+ SvREADONLY_on(sv);
+ SvPOK_on(sv);
+ return sv;
+}
+
+#endif
+
+#endif
+#ifndef SvSHARED_HASH
+# define SvSHARED_HASH(sv) (0 + SvUVX(sv))
+#endif
#ifndef WARN_ALL
# define WARN_ALL 0
#endif
@@ -4690,8 +5227,7 @@
# endif
#endif

-/* warner depends on vnewSVpvf */
-#if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(warner)
+#if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
#if defined(NEED_warner)
static void DPPP_(my_warner)(U32 err, const char *pat, ...);
static
@@ -4720,7 +5256,6 @@

#define warner Perl_warner

-/* Perl_warner_nocontext depends on warner */
#define Perl_warner_nocontext Perl_warner

#endif
@@ -4737,6 +5272,10 @@
# define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
#endif

+#ifndef newSVpvs_flags
+# define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
+#endif
+
#ifndef sv_catpvs
# define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
#endif
@@ -4912,14 +5451,6 @@
#endif

/* That's the best we can do... */
-#ifndef SvPV_force_nomg
-# define SvPV_force_nomg SvPV_force
-#endif
-
-#ifndef SvPV_nomg
-# define SvPV_nomg SvPV
-#endif
-
#ifndef sv_catpvn_nomg
# define sv_catpvn_nomg sv_catpvn
#endif
@@ -5037,6 +5568,47 @@
# define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
#endif

+/* Hint: sv_magic_portable
+ * This is a compatibility function that is only available with
+ * Devel::PPPort. It is NOT in the perl core.
+ * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
+ * it is being passed a name pointer with namlen == 0. In that
+ * case, perl 5.8.0 and later store the pointer, not a copy of it.
+ * The compatibility can be provided back to perl 5.004. With
+ * earlier versions, the code will not compile.
+ */
+
+#if (PERL_BCDVERSION < 0x5004000)
+
+ /* code that uses sv_magic_portable will not compile */
+
+#elif (PERL_BCDVERSION < 0x5008000)
+
+# define sv_magic_portable(sv, obj, how, name, namlen) \
+ STMT_START { \
+ SV *SvMp_sv = (sv); \
+ char *SvMp_name = (char *) (name); \
+ I32 SvMp_namlen = (namlen); \
+ if (SvMp_name && SvMp_namlen == 0) \
+ { \
+ MAGIC *mg; \
+ sv_magic(SvMp_sv, obj, how, 0, 0); \
+ mg = SvMAGIC(SvMp_sv); \
+ mg->mg_len = -42; /* XXX: this is the tricky part */ \
+ mg->mg_ptr = SvMp_name; \
+ } \
+ else \
+ { \
+ sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
+ } \
+ } STMT_END
+
+#else
+
+# define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
+
+#endif
+
#ifdef USE_ITHREADS
#ifndef CopFILE
# define CopFILE(c) ((c)->cop_file)
@@ -5164,8 +5736,6 @@
#ifndef IS_NUMBER_NAN
# define IS_NUMBER_NAN 0x20
#endif
-
-/* GROK_NUMERIC_RADIX depends on grok_numeric_radix */
#ifndef GROK_NUMERIC_RADIX
# define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
#endif
@@ -5241,8 +5811,6 @@
#endif
#endif

-/* grok_number depends on grok_numeric_radix */
-
#ifndef grok_number
#if defined(NEED_grok_number)
static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
@@ -5459,10 +6027,10 @@

#ifndef grok_bin
#if defined(NEED_grok_bin)
-static UV DPPP_(my_grok_bin)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result);
+static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
static
#else
-extern UV DPPP_(my_grok_bin)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result);
+extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
#endif

#ifdef grok_bin
@@ -5473,7 +6041,7 @@

#if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
UV
-DPPP_(my_grok_bin)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result)
+DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
{
const char *s = start;
STRLEN len = *len_p;
@@ -5561,10 +6129,10 @@

#ifndef grok_hex
#if defined(NEED_grok_hex)
-static UV DPPP_(my_grok_hex)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result);
+static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
static
#else
-extern UV DPPP_(my_grok_hex)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result);
+extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
#endif

#ifdef grok_hex
@@ -5575,7 +6143,7 @@

#if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
UV
-DPPP_(my_grok_hex)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result)
+DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
{
const char *s = start;
STRLEN len = *len_p;
@@ -5663,10 +6231,10 @@

#ifndef grok_oct
#if defined(NEED_grok_oct)
-static UV DPPP_(my_grok_oct)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result);
+static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
static
#else
-extern UV DPPP_(my_grok_oct)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result);
+extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
#endif

#ifdef grok_oct
@@ -5677,7 +6245,7 @@

#if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
UV
-DPPP_(my_grok_oct)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result)
+DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
{
const char *s = start;
STRLEN len = *len_p;


_______________________________________________
kinosearch-commits mailing list
kinosearch-commits@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch-commits