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?
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 $_() { \"",
# 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";