This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
warnings and const violations identified by compiling in C++ mode
[perl5.git] / makedef.pl
index a5e7f21..a5878ff 100644 (file)
 my $PLATFORM;
 my $CCTYPE;
 
+my %bincompat5005 =
+      (Perl_call_argv          =>      "perl_call_argv",
+       Perl_call_method                =>      "perl_call_method",
+       Perl_call_pv            =>      "perl_call_pv",
+       Perl_call_sv            =>      "perl_call_sv",
+       Perl_get_av             =>      "perl_get_av",
+       Perl_get_cv             =>      "perl_get_cv",
+       Perl_get_hv             =>      "perl_get_hv",
+       Perl_get_sv             =>      "perl_get_sv",
+       Perl_init_i18nl10n      =>      "perl_init_i18nl10n",
+       Perl_init_i18nl14n      =>      "perl_init_i18nl14n",
+       Perl_new_collate                =>      "perl_new_collate",
+       Perl_new_ctype          =>      "perl_new_ctype",
+       Perl_new_numeric                =>      "perl_new_numeric",
+       Perl_require_pv         =>      "perl_require_pv",
+       Perl_safesyscalloc      =>      "Perl_safecalloc",
+       Perl_safesysfree                =>      "Perl_safefree",
+       Perl_safesysmalloc      =>      "Perl_safemalloc",
+       Perl_safesysrealloc     =>      "Perl_saferealloc",
+       Perl_set_numeric_local  =>      "perl_set_numeric_local",
+       Perl_set_numeric_standard  =>   "perl_set_numeric_standard");
+
+my $bincompat5005 = join("|", keys %bincompat5005);
+
 while (@ARGV)
  {
   my $flag = shift;
@@ -68,6 +92,7 @@ while (<CFG>)
   $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/;
   $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/;
   $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/;
+  $define{$1} = 1 if /^\s*#\s*define\s+(PERL_BINCOMPAT_5005)\b/;
  }
 close(CFG);
 
@@ -190,6 +215,11 @@ Perl_my_memset
 PL_cshlen
 PL_cshname
 PL_opsave
+
+Perl_do_exec
+Perl_getenv_len
+Perl_my_pclose
+Perl_my_popen
 )];
 } elsif ($PLATFORM eq 'aix') {
     skip_symbols([qw(
@@ -234,6 +264,7 @@ threads_mutex
 nthreads
 nthreads_cond
 os2_cond_wait
+os2_stat
 pthread_join
 pthread_create
 pthread_detach
@@ -336,6 +367,7 @@ unless ($define{'USE_THREADS'} or $define{'PERL_IMPLICIT_CONTEXT'}
                   Perl_die_nocontext
                   Perl_deb_nocontext
                   Perl_form_nocontext
+                  Perl_mess_nocontext
                   Perl_warn_nocontext
                   Perl_warner_nocontext
                   Perl_newSVpvf_nocontext
@@ -628,7 +660,8 @@ elsif ($PLATFORM eq 'os2') {
   /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>;
   close MAP or die 'Cannot close miniperl.map';
   
-  @missing = grep { !exists $mapped{$_} } keys %export;
+  @missing = grep { !exists $mapped{$_} and !exists $bincompat5005{$_} }
+    keys %export;
   delete $export{$_} foreach @missing;
 }
 
@@ -648,6 +681,8 @@ sub emit_symbol {
 
 sub output_symbol {
     my $symbol = shift;
+    $symbol = $bincompat5005{$symbol}
+       if $define{PERL_BINCOMPAT_5005} and $symbol =~ /^($bincompat5005)$/;
     if ($PLATFORM eq 'win32') {
        $symbol = "_$symbol" if $CCTYPE eq 'BORLAND';
        print "\t$symbol\n";