Changeset 2174

Show
Ignore:
Timestamp:
06/07/08 09:33:42 (6 months ago)
Author:
mbr
Message:

updated to 2.18 from 2.16

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • psad/trunk/Storable/ChangeLog

    r2092 r2174  
     1Thu Nov 22 13:24:18 IST 2007   Abhijit Menon-Sen <ams@toroid.org> 
     2 
     3    Version 2.18 
     4 
     5        Compile fixes for older Perls. (No functional changes.) 
     6 
     7Sat Nov 17 02:12:12 IST 2007   Abhijit Menon-Sen <ams@toroid.org> 
     8 
     9    Version 2.17 
     10 
     11        Various broken tests fixed. (No functional changes.) 
     12 
    113Sat Mar 31 06:11:06 IST 2007   Abhijit Menon-Sen <ams@toroid.org> 
    214 
  • psad/trunk/Storable/MANIFEST

    r2092 r2174  
    3535t/malice.t                  See if Storable copes with corrupt files 
    3636t/overload.t                See if Storable works 
     37t/make_overload.pl          Make test data for overload.t 
    3738t/recurse.t                 See if Storable works 
    3839t/restrict.t                See if Storable works 
     
    5152t/Test/More.pm              For testing the CPAN release on pre 5.6.2 
    5253t/Test/Simple.pm            For testing the CPAN release on pre 5.6.2 
     54META.yml                                 Module meta-data (added by MakeMaker) 
  • psad/trunk/Storable/Storable.pm

    r2092 r2174  
    2424use vars qw($canonical $forgive_me $VERSION); 
    2525 
    26 $VERSION = '2.16'; 
     26$VERSION = '2.18'; 
    2727*AUTOLOAD = \&AutoLoader::AUTOLOAD;             # Grrr... 
    2828 
  • psad/trunk/Storable/Storable.xs

    r2092 r2174  
    2121#define NEED_load_module 
    2222#define NEED_vload_module 
     23#define NEED_newCONSTSUB 
    2324#include "ppport.h"             /* handle old perls */ 
    2425#endif 
  • psad/trunk/Storable/VERSION

    r2092 r2174  
    1 2.16 
     12.18 
  • psad/trunk/Storable/ppport.h

    r2092 r2174  
    55---------------------------------------------------------------------- 
    66 
    7     ppport.h -- Perl/Pollution/Portability Version 3.11 
    8  
    9     Automatically created by Devel::PPPort running under perl 5.008003
     7    ppport.h -- Perl/Pollution/Portability Version 3.13 
     8 
     9    Automatically created by Devel::PPPort running under perl 5.008008
    1010 
    1111    Do NOT edit this file directly! -- Edit PPPort_pm.PL and the 
     
    2222=head1 NAME 
    2323 
    24 ppport.h - Perl/Pollution/Portability version 3.11 
     24ppport.h - Perl/Pollution/Portability version 3.13 
    2525 
    2626=head1 SYNOPSIS 
     
    5757 
    5858This version of F<ppport.h> is designed to support operation with Perl 
    59 installations back to 5.003, and has been tested up to 5.9.4
     59installations back to 5.003, and has been tested up to 5.10.0
    6060 
    6161=head1 OPTIONS 
     
    7979If this option is given, a copy of each file will be saved with 
    8080the given suffix that contains the suggested changes. This does 
    81 not require any external programs. 
     81not require any external programs. Note that this does not 
     82automagially add a dot between the original filename and the 
     83suffix. If you want the dot, you have to include it in the option 
     84argument. 
    8285 
    8386If neither C<--patch> or C<--copy> are given, the default is to 
     
    118121 
    119122Don't output any hints. Hints often contain useful portability 
    120 notes. 
     123notes. Warnings will still be displayed. 
    121124 
    122125=head2 --nochanges 
     
    145148Lists the API elements for which compatibility is provided by 
    146149F<ppport.h>. Also lists if it must be explicitly requested, 
    147 if it has dependencies, and if there are hints for it. 
     150if it has dependencies, and if there are hints or warnings for it. 
    148151 
    149152=head2 --list-unsupported 
     
    222225    grok_numeric_radix()      NEED_grok_numeric_radix      NEED_grok_numeric_radix_GLOBAL 
    223226    grok_oct()                NEED_grok_oct                NEED_grok_oct_GLOBAL 
     227    load_module()             NEED_load_module             NEED_load_module_GLOBAL 
    224228    my_snprintf()             NEED_my_snprintf             NEED_my_snprintf_GLOBAL 
    225229    my_strlcat()              NEED_my_strlcat              NEED_my_strlcat_GLOBAL 
     
    227231    newCONSTSUB()             NEED_newCONSTSUB             NEED_newCONSTSUB_GLOBAL 
    228232    newRV_noinc()             NEED_newRV_noinc             NEED_newRV_noinc_GLOBAL 
    229     sv_2pv_nolen()            NEED_sv_2pv_nolen            NEED_sv_2pv_nolen_GLOBAL 
     233    newSVpvn_share()          NEED_newSVpvn_share          NEED_newSVpvn_share_GLOBAL 
     234    sv_2pv_flags()            NEED_sv_2pv_flags            NEED_sv_2pv_flags_GLOBAL 
    230235    sv_2pvbyte()              NEED_sv_2pvbyte              NEED_sv_2pvbyte_GLOBAL 
    231236    sv_catpvf_mg()            NEED_sv_catpvf_mg            NEED_sv_catpvf_mg_GLOBAL 
    232237    sv_catpvf_mg_nocontext()  NEED_sv_catpvf_mg_nocontext  NEED_sv_catpvf_mg_nocontext_GLOBAL 
     238    sv_pvn_force_flags()      NEED_sv_pvn_force_flags      NEED_sv_pvn_force_flags_GLOBAL 
    233239    sv_setpvf_mg()            NEED_sv_setpvf_mg            NEED_sv_setpvf_mg_GLOBAL 
    234240    sv_setpvf_mg_nocontext()  NEED_sv_setpvf_mg_nocontext  NEED_sv_setpvf_mg_nocontext_GLOBAL 
     241    vload_module()            NEED_vload_module            NEED_vload_module_GLOBAL 
    235242    vnewSVpvf()               NEED_vnewSVpvf               NEED_vnewSVpvf_GLOBAL 
    236243    warner()                  NEED_warner                  NEED_warner_GLOBAL 
     
    283290This would output context diffs with 10 lines of context. 
    284291 
     292If you want to create patched copies of your files instead, use: 
     293 
     294    perl ppport.h --copy=.new 
     295 
    285296To display portability information for the C<newSVpvn> function, 
    286297use: 
     
    358369use strict; 
    359370 
    360 my $VERSION = 3.11; 
     371# Disable broken TRIE-optimization 
     372BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 } 
     373 
     374my $VERSION = 3.13; 
    361375 
    362376my %opt = ( 
     
    374388my $LF = '(?:\r\n|[\r\n])';   # line feed 
    375389my $HS = "[ \t]";             # horizontal whitespace 
     390 
     391# Never use C comments in this file! 
     392my $ccs  = '/'.'*'; 
     393my $cce  = '*'.'/'; 
     394my $rccs = quotemeta $ccs; 
     395my $rcce = quotemeta $cce; 
    376396 
    377397eval { 
     
    409429  $opt{'compat-version'} = 5; 
    410430} 
    411  
    412 # Never use C comments in this file!!!!! 
    413 my $ccs  = '/'.'*'; 
    414 my $cce  = '*'.'/'; 
    415 my $rccs = quotemeta $ccs; 
    416 my $rcce = quotemeta $cce; 
    417431 
    418432my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/ 
     
    533547PERL_BCDVERSION|5.009005||p 
    534548PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p 
     549PERL_HASH|5.004000||p 
    535550PERL_INT_MAX|5.004000||p 
    536551PERL_INT_MIN|5.004000||p 
     
    551566PERL_MAGIC_isaelem|5.007002||p 
    552567PERL_MAGIC_isa|5.007002||p 
    553 PERL_MAGIC_mutex|5.007002||p 
     568PERL_MAGIC_mutex|5.009005||p 
    554569PERL_MAGIC_nkeys|5.007002||p 
    555570PERL_MAGIC_overload_elem|5.007002||p 
     
    609624PL_Sv|5.005000||p 
    610625PL_compiling|5.004050||p 
    611 PL_copline|5.005000||p 
     626PL_copline|5.009005||p 
    612627PL_curcop|5.004050||p 
    613628PL_curstash|5.004050||p 
     
    618633PL_dowarn|||pn 
    619634PL_errgv|5.004050||p 
     635PL_expect|5.009005||p 
    620636PL_hexdigit|5.005000||p 
    621637PL_hints|5.005000||p 
     
    688704PerlIO_unread||5.007003| 
    689705PerlIO_write||5.007003| 
    690 Perl_warner_nocontext|5.006000||p 
    691 Perl_warner|5.006000||p 
     706Perl_signbit||5.009005|n 
    692707PoisonFree|5.009004||p 
    693708PoisonNew|5.009004||p 
     
    710725STR_WITH_LEN|5.009003||p 
    711726ST||| 
     727SV_CONST_RETURN|5.009003||p 
     728SV_COW_DROP_PV|5.008001||p 
     729SV_COW_SHARED_HASH_KEYS|5.009005||p 
     730SV_GMAGIC|5.007002||p 
     731SV_HAS_TRAILING_NUL|5.009004||p 
     732SV_IMMEDIATE_UNREF|5.007001||p 
     733SV_MUTABLE_RETURN|5.009003||p 
     734SV_NOSTEAL|5.009002||p 
     735SV_SMAGIC|5.009003||p 
     736SV_UTF8_NO_ENCODING|5.008001||p 
    712737SVf|5.006000||p 
    713738SVt_IV||| 
     
    721746Slab_Alloc||| 
    722747Slab_Free||| 
     748Slab_to_rw||| 
    723749StructCopy||| 
    724750SvCUR_set||| 
     
    770796SvPVX_mutable|5.009003||p 
    771797SvPVX||| 
     798SvPV_const|5.009003||p 
     799SvPV_flags_const_nolen|5.009003||p 
     800SvPV_flags_const|5.009003||p 
     801SvPV_flags_mutable|5.009003||p 
     802SvPV_flags|5.007002||p 
     803SvPV_force_flags_mutable|5.009003||p 
     804SvPV_force_flags_nolen|5.009003||p 
     805SvPV_force_flags|5.007002||p 
     806SvPV_force_mutable|5.009003||p 
     807SvPV_force_nolen|5.009003||p 
     808SvPV_force_nomg_nolen|5.009003||p 
    772809SvPV_force_nomg|5.007002||p 
    773 SvPV_force||| 
     810SvPV_force|||p 
     811SvPV_mutable|5.009003||p 
     812SvPV_nolen_const|5.009003||p 
    774813SvPV_nolen|5.006000||p 
     814SvPV_nomg_const_nolen|5.009003||p 
     815SvPV_nomg_const|5.009003||p 
    775816SvPV_nomg|5.007002||p 
    776817SvPV_set||| 
     
    802843SvRV_set|5.009003||p 
    803844SvRV||| 
     845SvRXOK||5.009005| 
     846SvRX||5.009005| 
    804847SvSETMAGIC||| 
     848SvSHARED_HASH|5.009003||p 
    805849SvSHARE||5.007003| 
    806850SvSTASH_set|5.009003||p 
     
    817861SvTYPE||| 
    818862SvUNLOCK||5.007003| 
    819 SvUOK||5.007001| 
     863SvUOK|5.007001|5.006000|p 
    820864SvUPGRADE||| 
    821865SvUTF8_off||5.006000| 
     
    832876THIS|||n 
    833877UNDERBAR|5.009002||p 
     878UTF8_MAXBYTES|5.009002||p 
    834879UVSIZE|5.006000||p 
    835880UVTYPE|5.006000||p 
     
    840885WARN_ALL|5.006000||p 
    841886WARN_AMBIGUOUS|5.006000||p 
    842 WARN_ASSERTIONS|5.009000||p 
     887WARN_ASSERTIONS|5.009005||p 
    843888WARN_BAREWORD|5.006000||p 
    844889WARN_CLOSED|5.006000||p 
     
    921966aMY_CXT_|5.007003||p 
    922967aMY_CXT|5.007003||p 
    923 aTHXR_|||p 
    924 aTHXR|||p 
     968aTHXR_|5.009005||p 
     969aTHXR|5.009005||p 
    925970aTHX_|5.006000||p 
    926971aTHX|5.006000||p 
     
    946991av_arylen_p||5.009003| 
    947992av_clear||| 
     993av_create_and_push||5.009005| 
     994av_create_and_unshift_one||5.009005| 
    948995av_delete||5.006000| 
    949996av_exists||5.006000| 
     
    9701017boot_core_PerlIO||| 
    9711018boot_core_UNIVERSAL||| 
     1019boot_core_mro||| 
    9721020boot_core_xsutils||| 
    9731021bytes_from_utf8||5.007001| 
     
    10151063ck_null||| 
    10161064ck_open||| 
     1065ck_readline||| 
    10171066ck_repeat||| 
    10181067ck_require||| 
     
    10721121dSP||| 
    10731122dTHR|5.004050||p 
    1074 dTHXR|||p 
     1123dTHXR|5.009005||p 
    10751124dTHXa|5.006000||p 
    10761125dTHXoa|5.006000||p 
     
    11951244dumpuntil||| 
    11961245dup_attrlist||| 
     1246emulate_cop_io||| 
    11971247emulate_eaccess||| 
    11981248eval_pv|5.006000||p 
     
    12081258filter_gets||| 
    12091259filter_read||| 
     1260find_and_forget_pmops||| 
    12101261find_array_subscript||| 
    12111262find_beginning||| 
     
    12131264find_hash_subscript||| 
    12141265find_in_my_stash||| 
    1215 find_runcv||
     1266find_runcv||5.008001
    12161267find_rundefsvoffset||5.009002| 
    12171268find_script||| 
     
    12251276force_version||| 
    12261277force_word||| 
     1278forget_pmop||| 
    12271279form_nocontext|||vn 
    12281280form||5.004000|v 
     
    12361288get_av|5.006000||p 
    12371289get_context||5.006000|n 
     1290get_cvn_flags||5.009005| 
    12381291get_cv|5.006000||p 
    12391292get_db_sub||| 
     
    12481301get_opargs||| 
    12491302get_ppaddr||5.006000| 
     1303get_re_arg||| 
    12501304get_sv|5.006000||p 
    12511305get_vtbl||5.005030| 
     
    12771331gv_efullname||| 
    12781332gv_ename||| 
     1333gv_fetchfile_flags||5.009005| 
    12791334gv_fetchfile||| 
    12801335gv_fetchmeth_autoload||5.007003| 
     
    13591414init_ids||| 
    13601415init_interp||| 
    1361 init_lexer||| 
    13621416init_main_stash||| 
    13631417init_perllib||| 
     
    14471501list||| 
    14481502load_module_nocontext|||vn 
    1449 load_module||5.006000|
     1503load_module|5.006000||p
    14501504localize||| 
    14511505looks_like_bool||| 
     
    15551609more_sv||| 
    15561610moreswitches||| 
     1611mro_get_linear_isa_c3||5.009005| 
     1612mro_get_linear_isa_dfs||5.009005| 
     1613mro_get_linear_isa||5.009005| 
     1614mro_isa_changed_in||| 
     1615mro_meta_dup||| 
     1616mro_meta_init||| 
     1617mro_method_changed_in||5.009005| 
    15571618mul128||| 
    15581619mulexp10|||n 
     
    15701631my_chsize||| 
    15711632my_clearenv||| 
     1633my_cxt_index||| 
    15721634my_cxt_init||| 
     1635my_dirfd||5.009005| 
    15731636my_exit_jump||| 
    15741637my_exit||| 
     
    16511714newNULLLIST||| 
    16521715newOP||| 
    1653 newPADOP||5.006000
     1716newPADOP||
    16541717newPMOP||| 
    16551718newPROG||| 
     
    16641727newSVOP||| 
    16651728newSVREF||| 
     1729newSV_type||5.009005| 
    16661730newSVhek||5.009003| 
    16671731newSViv||| 
     
    16691733newSVpvf_nocontext|||vn 
    16701734newSVpvf||5.004000|v 
    1671 newSVpvn_share||5.007001| 
     1735newSVpvn_share|5.007001||p 
    16721736newSVpvn|5.004050||p 
    16731737newSVpvs_share||5.009003| 
     
    17161780op_getmad||| 
    17171781op_null||5.007002| 
     1782op_refcnt_dec||| 
     1783op_refcnt_inc||| 
    17181784op_refcnt_lock||5.009002| 
    17191785op_refcnt_unlock||5.009002| 
     
    17511817parse_body||| 
    17521818parse_unicode_opts||| 
     1819parser_dup||| 
     1820parser_free||| 
    17531821path_is_absolute|||n 
    17541822peep||| 
    1755 pending_ident||| 
     1823pending_Slabs_to_ro||| 
    17561824perl_alloc_using|||n 
    17571825perl_alloc|||n 
     
    17711839pmtrans||| 
    17721840pop_scope||| 
    1773 pregcomp||
     1841pregcomp||5.009005
    17741842pregexec||| 
    17751843pregfree||| 
     
    17781846printbuf||| 
    17791847printf_nocontext|||vn 
    1780 ptr_table_clear||| 
    1781 ptr_table_fetch||| 
     1848process_special_blocks||| 
     1849ptr_table_clear||5.009005| 
     1850ptr_table_fetch||5.009005| 
    17821851ptr_table_find|||n 
    1783 ptr_table_free||
    1784 ptr_table_new||
    1785 ptr_table_split||
    1786 ptr_table_store||
     1852ptr_table_free||5.009005
     1853ptr_table_new||5.009005
     1854ptr_table_split||5.009005
     1855ptr_table_store||5.009005
    17871856push_scope||| 
    17881857put_byte||| 
     
    17931862qerror||| 
    17941863qsortsvu||| 
     1864re_compile||5.009005| 
    17951865re_croak2||| 
    17961866re_dup||| 
    1797 re_intuit_start||5.006000
     1867re_intuit_start||5.009005
    17981868re_intuit_string||5.006000| 
    17991869readpipe_override||| 
     
    18131883ref||5.009003| 
    18141884reg_check_named_buff_matched||| 
    1815 reg_named_buff_sv||| 
     1885reg_named_buff_all||5.009005| 
     1886reg_named_buff_exists||5.009005| 
     1887reg_named_buff_fetch||5.009005| 
     1888reg_named_buff_firstkey||5.009005| 
     1889reg_named_buff_iter||| 
     1890reg_named_buff_nextkey||5.009005| 
     1891reg_named_buff_scalar||5.009005| 
     1892reg_named_buff||| 
    18161893reg_namedseq||| 
    18171894reg_node||| 
     1895reg_numbered_buff_fetch||| 
     1896reg_numbered_buff_length||| 
     1897reg_numbered_buff_store||| 
     1898reg_qr_package||| 
    18181899reg_recode||| 
    18191900reg_scan_name||| 
    1820 reg_stringify||| 
     1901reg_skipcomment||| 
     1902reg_stringify||5.009005| 
     1903reg_temp_copy||| 
    18211904reganode||| 
    18221905regatom||| 
     
    18271910regcppush||| 
    18281911regcurly|||n 
     1912regdump_extflags||| 
    18291913regdump||5.005000| 
    1830 regdupe||| 
     1914regdupe_internal||| 
    18311915regexec_flags||5.005000| 
     1916regfree_internal||5.009005| 
    18321917reghop3|||n 
    18331918reghop4|||n 
     
    18511936report_evil_fh||| 
    18521937report_uninit||| 
    1853 require_errno||| 
    18541938require_pv||5.006000| 
     1939require_tie_mod||| 
    18551940restore_magic||| 
    18561941rninstr||| 
     
    19182003savepvs||5.009003| 
    19192004savepv||| 
     2005savesharedpvn||5.009005| 
    19202006savesharedpv||5.007003| 
    19212007savestack_grow_cnt||5.008001| 
     
    19442030scan_trans||| 
    19452031scan_version||5.009001| 
    1946 scan_vstring||5.008001
     2032scan_vstring||5.009005
    19472033scan_word||| 
    19482034scope||| 
     
    19682054skipspace2||| 
    19692055skipspace||| 
     2056softref2xv||| 
    19702057sortcv_stacked||| 
    19712058sortcv_xsub||| 
     
    20052092sv_2mortal||| 
    20062093sv_2nv||| 
    2007 sv_2pv_flags||5.007002| 
     2094sv_2pv_flags|5.007002||p 
    20082095sv_2pv_nolen|5.006000||p 
    2009 sv_2pvbyte_nolen||| 
     2096sv_2pvbyte_nolen|5.006000||p 
    20102097sv_2pvbyte|5.006000||p 
    20112098sv_2pvutf8_nolen||5.006000| 
     
    20692156sv_len_utf8||5.006000| 
    20702157sv_len||| 
     2158sv_magic_portable|5.009005|5.004000|p 
    20712159sv_magicext||5.007003| 
    20722160sv_magic||| 
     
    20892177sv_pvbyten||5.006000| 
    20902178sv_pvbyte||5.006000| 
    2091 sv_pvn_force_flags||5.007002| 
    2092 sv_pvn_force|||p 
     2179sv_pvn_force_flags|5.007002||p 
     2180sv_pvn_force||| 
    20932181sv_pvn_nomg|5.007003||p 
    2094 sv_pvn|5.005000||p 
     2182sv_pvn||| 
    20952183sv_pvutf8n_force||5.006000| 
    20962184sv_pvutf8n||5.006000| 
     
    21002188sv_reftype||| 
    21012189sv_release_COW||| 
    2102 sv_release_IVX||| 
    21032190sv_replace||| 
    21042191sv_report_used||| 
     
    21602247svtype||| 
    21612248swallow_bom||| 
     2249swap_match_buff||| 
    21622250swash_fetch||5.007002| 
    21632251swash_get||| 
     
    22012289unsharepvn||5.004000| 
    22022290unwind_handler_stack||| 
    2203 upg_version||5.009000| 
     2291update_debugger_info||| 
     2292upg_version||5.009005| 
    22042293usage||| 
    22052294utf16_to_utf8_reversed||5.006001| 
     
    22312320vivify_defelem||| 
    22322321vivify_ref||| 
    2233 vload_module||5.006000| 
     2322vload_module|5.006000||p 
    22342323vmess||5.006000| 
    22352324vnewSVpvf|5.006000|5.004000|p 
     
    22742363# Scan for possible replacement candidates 
    22752364 
    2276 my(%replace, %need, %hints, %depends); 
     2365my(%replace, %need, %hints, %warnings, %depends); 
    22772366my $replace = 0; 
    2278 my $hint = ''; 
     2367my($hint, $define, $function); 
     2368 
     2369sub find_api 
     2370
     2371  my $code = shift; 
     2372  $code =~ s{ 
     2373    / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*) 
     2374  | "[^"\\]*(?:\\.[^"\\]*)*" 
     2375  | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx; 
     2376  grep { exists $API{$_} } $code =~ /(\w+)/mg; 
     2377
    22792378 
    22802379while (<DATA>) { 
    22812380  if ($hint) { 
     2381    my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings; 
    22822382    if (m{^\s*\*\s(.*?)\s*$}) { 
    2283       $hints{$hint} ||= '';  # suppress warning with older perls 
    2284       $hints{$hint} .= "$1\n"; 
     2383      for (@{$hint->[1]}) { 
     2384        $h->{$_} ||= '';  # suppress warning with older perls 
     2385        $h->{$_} .= "$1\n"; 
     2386      } 
     2387    } 
     2388    else { undef $hint } 
     2389  } 
     2390 
     2391  $hint = [$1, [split /,?\s+/, $2]] 
     2392      if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$}; 
     2393 
     2394  if ($define) { 
     2395    if ($define->[1] =~ /\\$/) { 
     2396      $define->[1] .= $_; 
    22852397    } 
    22862398    else { 
    2287       $hint = ''; 
     2399      if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) { 
     2400        my @n = find_api($define->[1]); 
     2401        push @{$depends{$define->[0]}}, @n if @n 
     2402      } 
     2403      undef $define; 
    22882404    } 
    22892405  } 
    2290   $hint = $1 if m{^\s*$rccs\sHint:\s+(\w+)\s*$}; 
     2406 
     2407  $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)}; 
     2408 
     2409  if ($function) { 
     2410    if (/^}/) { 
     2411      if (exists $API{$function->[0]}) { 
     2412        my @n = find_api($function->[1]); 
     2413        push @{$depends{$function->[0]}}, @n if @n 
     2414      } 
     2415      undef $define; 
     2416    } 
     2417    else { 
     2418      $function->[1] .= $_; 
     2419    } 
     2420  } 
     2421 
     2422  $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)}; 
    22912423 
    22922424  $replace     = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$}; 
     
    23002432 
    23012433  $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)}; 
     2434} 
     2435 
     2436for (values %depends) { 
     2437  my %s; 
     2438  $_ = [sort grep !$s{$_}++, @$_]; 
    23022439} 
    23032440 
     
    23202457      print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f}; 
    23212458      print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f}; 
    2322       print "$hints{$f}" if exists $hints{$f}; 
     2459      print "\n$hints{$f}" if exists $hints{$f}; 
     2460      print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f}; 
    23232461      $info++; 
    23242462    } 
    2325     unless ($info) { 
    2326       print "No portability information available.\n"; 
    2327     } 
     2463    print "No portability information available.\n" unless $info; 
    23282464    $count++; 
    23292465  } 
    2330   if ($count > 0) { 
    2331     print "\n"; 
    2332   } 
    2333   else { 
    2334     print "Found no API matching '$opt{'api-info'}'.\n"; 
    2335   } 
     2466  $count or print "Found no API matching '$opt{'api-info'}'."; 
     2467  print "\n"; 
    23362468  exit 0; 
    23372469} 
     
    23452477    push @flags, 'depend'   if exists $depends{$f}; 
    23462478    push @flags, 'hint'     if exists $hints{$f}; 
     2479    push @flags, 'warning'  if exists $warnings{$f}; 
    23472480    my $flags = @flags ? '  ['.join(', ', @flags).']' : ''; 
    23482481    print "$f$flags\n"; 
     
    23522485 
    23532486my @files; 
    2354 my @srcext = qw( xs c h cc cpp ); 
    2355 my $srcext = join '|', @srcext; 
     2487my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc ); 
     2488my $srcext = join '|', map { quotemeta $_ } @srcext; 
    23562489 
    23572490if (@ARGV) { 
    23582491  my %seen; 
    2359   @files = grep { -f && !exists $seen{$_} } map { glob $_ } @ARGV; 
     2492  for (@ARGV) { 
     2493    if (-e) { 
     2494      if (-f) { 
     2495        push @files, $_ unless $seen{$_}++; 
     2496      } 
     2497      else { warn "'$_' is not a file.\n" } 
     2498    } 
     2499    else { 
     2500      my @new = grep { -f } glob $_ 
     2501          or warn "'$_' does not exist.\n"; 
     2502      push @files, grep { !$seen{$_}++ } @new; 
     2503    } 
     2504  } 
    23602505} 
    23612506else { 
     
    23632508    require File::Find; 
    23642509    File::Find::find(sub { 
    2365       $File::Find::name =~ /\.($srcext)$/i 
     2510      $File::Find::name =~ /($srcext)$/i 
    23662511          and push @files, $File::Find::name; 
    23672512    }, '.'); 
    23682513  }; 
    23692514  if ($@) { 
    2370     @files = map { glob "*.$_" } @srcext; 
     2515    @files = map { glob "*$_" } @srcext; 
    23712516  } 
    23722517} 
     
    23762521  my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files; 
    23772522  for (@files) { 
    2378     my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/\.($srcext)$/i; 
     2523    my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i; 
    23792524    push @{ $out ? \@out : \@in }, $_; 
    23802525  } 
     
    23852530} 
    23862531 
    2387 unless (@files) { 
    2388   die "No input files given!\n"; 
    2389 
     2532die "No input files given!\n" unless @files; 
    23902533 
    23912534my(%files, %global, %revreplace); 
     
    24072550  my %file = (orig => $c, changes => 0); 
    24082551 
    2409   # temporarily remove C comments from the code 
     2552  # Temporarily remove C/XS comments and strings from the code 
    24102553  my @ccom; 
     2554 
    24112555  $c =~ s{ 
    2412     ( 
    2413         [^"'/]+ 
    2414       | 
    2415         (?:"[^"\\]*(?:\\.[^"\\]*)*" [^"'/]*)+ 
    2416       | 
    2417         (?:'[^'\\]*(?:\\.[^'\\]*)*' [^"'/]*)+ 
    2418     ) 
    2419   | 
    2420     (/ (?: 
    2421         \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / 
    2422         | 
    2423         /[^\r\n]* 
    2424       )) 
    2425   }{ 
    2426     defined $2 and push @ccom, $2; 
    2427     defined $1 ? $1 : "$ccs$#ccom$cce"; 
    2428   }egsx; 
     2556    ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]* 
     2557    | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* ) 
     2558  | ( ^$HS*\#[^\r\n]* 
     2559    | "[^"\\]*(?:\\.[^"\\]*)*" 
     2560    | '[^'\\]*(?:\\.[^'\\]*)*' 
     2561    | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) ) 
     2562  }{ defined $2 and push @ccom, $2; 
     2563     defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex; 
    24292564 
    24302565  $file{ccom} = \@ccom; 
    24312566  $file{code} = $c; 
    2432   $file{has_inc_ppport} = ($c =~ /#.*include.*\Q$ppport\E/)
     2567  $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m
    24332568 
    24342569  my $func; 
     
    24412576      $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/; 
    24422577      if (exists $API{$func}{provided}) { 
     2578        $file{uses_provided}{$func}++; 
    24432579        if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) { 
    24442580          $file{uses}{$func}++; 
     
    24512587          } 
    24522588          for ($func, @deps) { 
    2453             if (exists $need{$_}) { 
    2454               $file{needs}{$_} = 'static'; 
    2455             } 
     2589            $file{needs}{$_} = 'static' if exists $need{$_}; 
    24562590          } 
    24572591        } 
     
    24692603      $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++; 
    24702604    } 
    2471     else { 
    2472       warning("Possibly wrong #define $1 in $filename"); 
    2473     } 
     2605    else { warning("Possibly wrong #define $1 in $filename") } 
    24742606  } 
    24752607 
     
    25082640  my $func; 
    25092641  my $c = $file{code}; 
     2642  my $warnings = 0; 
    25102643 
    25112644  for $func (sort keys %{$file{uses_Perl}}) { 
    25122645    if ($API{$func}{varargs}) { 
    2513       my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))} 
    2514                             { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge); 
    2515       if ($changes) { 
    2516         warning("Doesn't pass interpreter argument aTHX to Perl_$func"); 
    2517         $file{changes} += $changes; 
     2646      unless ($API{$func}{nothxarg}) { 
     2647        my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))} 
     2648                              { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge); 
     2649        if ($changes) { 
     2650          warning("Doesn't pass interpreter argument aTHX to Perl_$func"); 
     2651          $file{changes} += $changes; 
     2652        } 
    25182653      } 
    25192654    } 
     
    25302665  } 
    25312666 
    2532   for $func (sort keys %{$file{uses}}) { 
    2533     next unless $file{uses}{$func};   # if it's only a dependency 
    2534     if (exists $file{uses_deps}{$func}) { 
    2535       diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}})); 
     2667  for $func (sort keys %{$file{uses_provided}}) { 
     2668    if ($file{uses}{$func}) { 
     2669      if (exists $file{uses_deps}{$func}) { 
     2670        diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}})); 
     2671      } 
     2672      else { 
     2673        diag("Uses $func"); 
     2674      } 
    25362675    } 
    2537     elsif (exists $replace{$func}) { 
    2538       warning("Uses $func instead of $replace{$func}"); 
    2539       $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g); 
     2676    $warnings += hint($func); 
     2677  } 
     2678 
     2679  unless ($opt{quiet}) { 
     2680    for $func (sort keys %{$file{uses_todo}}) { 
     2681      print "*** WARNING: Uses $func, which may not be portable below perl ", 
     2682            format_version($API{$func}{todo}), ", even with '$ppport'\n"; 
     2683      $warnings++; 
    25402684    } 
    2541     else { 
    2542       diag("Uses $func"); 
    2543     } 
    2544     hint($func); 
    2545   } 
    2546  
    2547   for $func (sort keys %{$file{uses_todo}}) { 
    2548     warning("Uses $func, which may not be portable below perl ", 
    2549             format_version($API{$func}{todo})); 
    25502685  } 
    25512686 
     
    26452780    warning("Uses $cppc C++ style comment$s, which is not portable"); 
    26462781  } 
     2782 
     2783  my $s = $warnings != 1 ? 's' : ''; 
     2784  my $warn = $warnings ? " ($warnings warning$s)" : ''; 
     2785  info("Analysis completed$warn"); 
    26472786 
    26482787  if ($file{changes}) { 
     
    27002839 
    27012840 
     2841sub try_use { eval "use @_;"; return $@ eq '' } 
     2842 
    27022843sub mydiff 
    27032844{ 
     
    27102851  } 
    27112852 
    2712   if (!defined $diff and can_use('Text::Diff')) { 
     2853  if (!defined $diff and try_use('Text::Diff')) { 
    27132854    $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' }); 
    27142855    $diff = <<HEADER . $diff; 
     
    27322873 
    27332874  print F $diff; 
    2734  
    27352875} 
    27362876 
     
    27692909} 
    27702910 
    2771 sub can_use 
    2772 { 
    2773   eval "use @_;"; 
    2774   return $@ eq ''; 
    2775 } 
    2776  
    27772911sub rec_depend 
    27782912{ 
    2779   my $func = shift; 
    2780   my %seen; 
     2913  my($func, $seen) = @_; 
    27812914  return () unless exists $depends{$func}; 
    2782   grep !$seen{$_}++, map { ($_, rec_depend($_)) } @{$depends{$func}}; 
     2915  $seen = {%{$seen||{}}}; 
     2916  return () if $seen->{$func}++; 
     2917  my %s; 
     2918  grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}}; 
    27832919} 
    27842920 
     
    28602996 
    28612997my %given_hints; 
     2998my %given_warnings; 
    28622999sub hint 
    28633000{ 
    28643001  $opt{quiet} and return; 
    2865   $opt{hints} or return; 
    28663002  my $func = shift; 
    2867   exists $hints{$func} or return; 
    2868   $given_hints{$func}++ and return; 
    2869   my $hint = $hints{$func}; 
    2870   $hint =~ s/^/   /mg; 
    2871   print "   --- hint for $func ---\n", $hint; 
     3003  my $rv = 0; 
     3004  if (exists $warnings{$func} && !$given_warnings{$func}++) { 
     3005    my $warn = $warnings{$func}; 
     3006    $warn =~ s!^!*** !mg; 
     3007    print "*** WARNING: $func\n", $warn; 
     3008    $rv++; 
     3009  } 
     3010  if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) { 
     3011    my $hint = $hints{$func}; 
     3012    $hint =~ s/^/   /mg; 
     3013    print "   --- hint for $func ---\n", $hint; 
     3014  } 
     3015  $rv; 
    28723016} 
    28733017 
     
    29193063END 
    29203064/ms; 
     3065  my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms; 
     3066  $c =~ s{ 
     3067    / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*) 
     3068  | ( "[^"\\]*(?:\\.[^"\\]*)*" 
     3069    | '[^'\\]*(?:\\.[^'\\]*)*' ) 
     3070  | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex; 
     3071  $c =~ s!\s+$!!mg; 
     3072  $c =~ s!^$LF!!mg; 
     3073  $c =~ s!^\s*#\s*!#!mg; 
     3074  $c =~ s!^\s+!!mg; 
    29213075 
    29223076  open OUT, ">$0" or die "cannot strip $0: $!\n"; 
    2923   print OUT $self
     3077  print OUT "$pl$c\n"
    29243078 
    29253079  exit 0; 
     
    29573111#endif 
    29583112 
    2959 #define PERL_BCDVERSION ((PERL_REVISION * 0x1000000L) + (PERL_VERSION * 0x1000L) + PERL_SUBVERSION) 
     3113#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10)) 
     3114#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION)) 
    29603115 
    29613116/* It is very unlikely that anyone will try to use this with Perl 6 
     
    33423497#  define sv_uv(sv)                      SvUVx(sv) 
    33433498#endif 
     3499 
     3500#if !defined(SvUOK) && defined(SvIOK_UV) 
     3501#  define SvUOK(sv) SvIOK_UV(sv) 
     3502#endif 
    33443503#ifndef XST_mUV 
    33453504#  define XST_mUV(i,v)                   (ST(i) = sv_2mortal(newSVuv(v))  ) 
     
    36163775#endif 
    36173776 
    3618 #if ((PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION < 0))
     3777#if (PERL_BCDVERSION < 0x5005000
    36193778#  undef XSRETURN 
    36203779#  define XSRETURN(off)                                   \ 
     
    36333792#  define SVf                            "_" 
    36343793#endif 
     3794#ifndef UTF8_MAXBYTES 
     3795#  define UTF8_MAXBYTES                  UTF8_MAXLEN 
     3796#endif 
     3797#ifndef PERL_HASH 
     3798#  define PERL_HASH(hash,str,len)        \ 
     3799     STMT_START { \ 
     3800        const char *s_PeRlHaSh = str; \ 
     3801        I32 i_PeRlHaSh = len; \ 
     3802        U32 hash_PeRlHaSh = 0; \ 
     3803        while (i_PeRlHaSh--) \ 
     3804            hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \ 
     3805        (hash) = hash_PeRlHaSh; \ 
     3806    } STMT_END 
     3807#endif 
    36353808 
    36363809#ifndef PERL_SIGNALS_UNSAFE_FLAG 
     
    36383811#define PERL_SIGNALS_UNSAFE_FLAG 0x0001 
    36393812 
    3640 #if ((PERL_VERSION < 8) || ((PERL_VERSION == 8) && (PERL_SUBVERSION < 0))
     3813#if (PERL_BCDVERSION < 0x5008000
    36413814#  define D_PPP_PERL_SIGNALS_INIT   PERL_SIGNALS_UNSAFE_FLAG 
    36423815#else 
     
    36623835 */ 
    36633836 
    3664 #if ((PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION <= 4))
     3837#if (PERL_BCDVERSION <= 0x5005005
    36653838/* Replace: 1 */ 
    36663839#  define PL_ppaddr                 ppaddr 
     
    36693842#endif 
    36703843 
    3671 #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))
     3844#if (PERL_BCDVERSION <= 0x5004005
    36723845/* Replace: 1 */ 
    36733846#  define PL_DBsignal               DBsignal 
     
    36863859#  define PL_dowarn                 dowarn 
    36873860#  define PL_errgv                  errgv 
     3861#  define PL_expect                 expect 
    36883862#  define PL_hexdigit               hexdigit 
    36893863#  define PL_hints                  hints 
     
    37063880/* Replace: 0 */ 
    37073881#endif 
     3882 
     3883/* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters 
     3884 * Do not use this variable. It is internal to the perl parser 
     3885 * and may change or even be removed in the future. Note that 
     3886 * as of perl 5.9.5 you cannot assign to this variable anymore. 
     3887 */ 
     3888 
     3889/* TODO: cannot assign to these vars; is it worth fixing? */ 
     3890#if (PERL_BCDVERSION >= 0x5009005) 
     3891#  define PL_expect         (PL_parser ? PL_parser->expect : 0) 
     3892#  define PL_copline        (PL_parser ? PL_parser->copline : 0) 
     3893#  define PL_rsfp           (PL_parser ? PL_parser->rsfp : (PerlIO *) 0) 
     3894#  define PL_rsfp_filters   (PL_parser ? PL_parser->rsfp_filters : (AV *) 0) 
     3895#endif 
    37083896#ifndef dTHR 
    37093897#  define dTHR                           dNOOP 
     
    37323920#endif 
    37333921 
    3734 #if ((PERL_VERSION < 6) || ((PERL_VERSION == 6) && (PERL_SUBVERSION < 0))
     3922#if (PERL_BCDVERSION < 0x5006000
    37353923#  ifdef USE_THREADS 
    37363924#    define aTHXR  thr 
    3737 #    define aTHXR_ thr,  
     3925#    define aTHXR_ thr, 
    37383926#  else 
    37393927#    define aTHXR 
     
    38073995#  define eval_sv                        perl_eval_sv