X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=utils%2Fh2ph.PL;h=0b0208b0ca40df1a551fa142f5e3bc0d5a9a3b8f;hb=fcbfa962e80dc16f8db1afaeb5287e8a393d3942;hp=6011d98f1f1e3d3b69a82922aa5d561e712115e8;hpb=7f04632dc7331d954369edc888e0d378dd766af3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/utils/h2ph.PL b/utils/h2ph.PL index 6011d98..0b0208b 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -528,7 +528,7 @@ sub inc_dirs sub build_preamble_if_necessary { # Increment $VERSION every time this function is modified: - my $VERSION = 1; + my $VERSION = 2; my $preamble = "$Dest_dir/_h2ph_pre.ph"; # Can we skip building the preamble file? @@ -556,6 +556,9 @@ sub build_preamble_if_necessary if ($define{$_} =~ /^\d+$/) { print PREAMBLE "unless (defined &$_) { sub $_() { $define{$_} } }\n\n"; + } elsif ($define{$_} =~ /^\w+$/) { + print PREAMBLE + "unless (defined &$_) { sub $_() { &$define{$_} } }\n\n"; } else { print PREAMBLE "unless (defined &$_) { sub $_() { \"", @@ -576,8 +579,7 @@ sub _extract_cc_defines # Split compiler pre-definitions into `key=value' pairs: foreach (split /\s+/, $allsymbols) { - /(.*?)=(.*)/; - $define{$1} = $2; + /(.+?)=(.+)/ and $define{$1} = $2; if ($opt_D) { print STDERR "$_: $1 -> $2\n";