X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/8c8d0d995d9a47cd5c8fdefd2cecd9a2d752ace4..8530ff282653a25fc2e4a3560c503d74509ca31b:/overload.pl diff --git a/overload.pl b/overload.pl index 38331cb..d4ba9a7 100644 --- a/overload.pl +++ b/overload.pl @@ -1,9 +1,18 @@ #!/usr/bin/perl -w - # -# Generate overload.h +# Regenerate (overwriting only if changed): +# +# overload.h +# overload.c +# lib/overload/numbers.pm +# +# from information stored in the DATA section of this file. +# # This allows the order of overloading constants to be changed. -# +# +# Accepts the standard regen_lib -q and -v args. +# +# This script is normally invoked from regen.pl. BEGIN { # Get function prototypes @@ -23,9 +32,9 @@ while () { push @names, $name; } -safer_unlink ('overload.h', 'overload.c', catfile(qw(lib overload numbers.pm))); -my $c = safer_open("overload.c"); -my $h = safer_open("overload.h"); +safer_unlink (catfile(qw(lib overload numbers.pm))); +my $c = safer_open("overload.c-new"); +my $h = safer_open("overload.h-new"); mkdir("lib/overload") unless -d catdir(qw(lib overload)); my $p = safer_open(catfile(qw(lib overload numbers.pm))); @@ -141,6 +150,8 @@ EOT safer_close($h); safer_close($c); safer_close($p); +rename_if_different("overload.c-new", "overload.c"); +rename_if_different("overload.h-new","overload.h"); __DATA__ # Fallback should be the first @@ -218,5 +229,6 @@ concat (. concat_ass (.= smart (~~ ftest (-X +regexp (qr # Note: Perl_Gv_AMupdate() assumes that DESTROY is the last entry DESTROY DESTROY