This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
handy.h: Free up bits in PL_charclass[]
[perl5.git] / makedef.pl
index b648a65..c1fd4c1 100644 (file)
@@ -40,6 +40,8 @@ my %ARGS = (CCTYPE => 'MSVC', TARG_DIR => '');
 
 my %define;
 
+my $fold;
+
 sub process_cc_flags {
     foreach (map {split /\s+/, $_} @_) {
        $define{$1} = $2 // 1 if /^-D(\w+)(?:=(.+))?/;
@@ -52,6 +54,8 @@ while (@ARGV) {
        process_cc_flags($1);
     } elsif ($flag =~ /^(CCTYPE|FILETYPE|PLATFORM|TARG_DIR)=(.+)$/) {
        $ARGS{$1} = $2;
+    } elsif ($flag eq '--sort-fold') {
+       ++$fold;
     }
 }
 
@@ -107,10 +111,6 @@ close(CFG);
 
 # perl.h logic duplication begins
 
-if ($define{PERL_IMPLICIT_SYS}) {
-    $define{PL_OP_SLAB_ALLOC} = 1;
-}
-
 if ($define{USE_ITHREADS}) {
     if (!$define{MULTIPLICITY}) {
         $define{MULTIPLICITY} = 1;
@@ -196,6 +196,9 @@ if ($ARGS{PLATFORM} ne 'os2') {
                         );
     if ($ARGS{PLATFORM} eq 'vms') {
        ++$skip{PL_statusvalue_posix};
+        # This is a wrapper if we have symlink, not a replacement
+        # if we don't.
+        ++$skip{Perl_my_symlink} unless $Config{d_symlink};
     } else {
        ++$skip{PL_statusvalue_vms};
        if ($ARGS{PLATFORM} ne 'aix') {
@@ -240,7 +243,6 @@ unless ($define{'DEBUGGING'}) {
                    Perl_pad_sv
                    Perl_pad_setsv
                    Perl_hv_assert
-                   PL_block_type
                    PL_watchaddr
                    PL_watchok
                    PL_watch_pvx
@@ -340,6 +342,7 @@ unless ($define{'USE_ITHREADS'}) {
 
 unless ($define{'USE_ITHREADS'}) {
     ++$skip{$_} foreach qw(
+                   PL_check_mutex
                    PL_op_mutex
                    PL_regex_pad
                    PL_regex_padav
@@ -347,6 +350,10 @@ unless ($define{'USE_ITHREADS'}) {
                    PL_hints_mutex
                    PL_my_ctx_mutex
                    PL_perlio_mutex
+                   PL_stashpad
+                   PL_stashpadix
+                   PL_stashpadmax
+                   Perl_alloccopstash
                    Perl_clone_params_del
                    Perl_clone_params_new
                    Perl_parser_dup
@@ -397,27 +404,6 @@ unless ($define{'PERL_IMPLICIT_CONTEXT'}) {
                         );
 }
 
-unless ($define{'PL_OP_SLAB_ALLOC'}) {
-    ++$skip{$_} foreach qw(
-                     PL_OpPtr
-                     PL_OpSlab
-                     PL_OpSpace
-                    Perl_Slab_Alloc
-                    Perl_Slab_Free
-                        );
-}
-
-unless ($define{'PERL_DEBUG_READONLY_OPS'}) {
-    ++$skip{$_} foreach qw(
-                   PL_slab_count
-                   PL_slabs
-                        );
-}
-
-unless ($define{'THREADS_HAVE_PIDS'}) {
-    ++$skip{PL_ppid};
-}
-
 unless ($define{'PERL_NEED_APPCTX'}) {
     ++$skip{PL_appctx};
 }
@@ -548,6 +534,7 @@ my @layer_syms = qw(
                    PerlIOBase_eof
                    PerlIOBase_error
                    PerlIOBase_fileno
+                   PerlIOBase_open
                    PerlIOBase_noop_fail
                    PerlIOBase_noop_ok
                    PerlIOBase_popped
@@ -965,9 +952,6 @@ if ($ARGS{PLATFORM} =~ /^win(?:32|ce)$/) {
                            win32_getchar
                            win32_putchar
                 ));
-    if ($ARGS{CCTYPE} eq "BORLAND") {
-       try_symbols('_matherr');
-    }
 }
 elsif ($ARGS{PLATFORM} eq 'vms') {
     try_symbols(qw(
@@ -1305,7 +1289,7 @@ if ($ARGS{PLATFORM} =~ /^win(?:32|ce)$/) {
     print "LIBRARY $dll\n";
     # The DESCRIPTION module definition file statement is not supported
     # by VC7 onwards.
-    if ($ARGS{CCTYPE} =~ /^(?:MSVC60|GCC|BORLAND)$/) {
+    if ($ARGS{CCTYPE} =~ /^(?:MSVC60|GCC)$/) {
        print "DESCRIPTION 'Perl interpreter'\n";
     }
     print "EXPORTS\n";
@@ -1347,9 +1331,9 @@ elsif ($ARGS{PLATFORM} eq 'netware') {
 
 # Then the symbols
 
-foreach my $symbol (sort keys %export) {
+my @symbols = $fold ? sort {lc $a cmp lc $b} keys %export : sort keys %export;
+foreach my $symbol (@symbols) {
     if ($ARGS{PLATFORM} =~ /^win(?:32|ce)$/) {
-       $symbol = "_$symbol" if $ARGS{CCTYPE} eq 'BORLAND';
        print "\t$symbol\n";
     }
     elsif ($ARGS{PLATFORM} eq 'os2') {