Index: tools/winemaker =================================================================== RCS file: /var/cvs/wine/tools/winemaker,v retrieving revision 1.79 diff -u -p -r1.79 winemaker --- tools/winemaker 11 Jan 2005 10:39:10 -0000 1.79 +++ tools/winemaker 20 Feb 2005 00:30:11 -0000 @@ -1479,6 +1478,37 @@ sub fix_file($$$) } } else { + my $again=1; + while ($again) + { + $again=0; + if (/\b([0-9]+|0x[0-9a-f]+)i64(?! \/* winemaker)/i) { + # Fix non-portable 64 bit values + my $number=$&; + my $value=$1; + if ($value =~ /^0[0-9]/) { + # BigInt does not support octal + s%$number%((__int64)$value) /* winemaker:warning: non portable 64 bit number */%g; + } else { + use Math::BigInt; + my $v=Math::BigInt->new($value); + my $high=$v >> 32; + my $low=$v & 0xffffffff; + if ($high == 0) { + $low=$low->as_hex() if ($value =~ /^0x/i); + s%$number%((__int64)$low) /* winemaker:warning: non portable 64 bit number: $value */%g; + } elsif ($low == 0) { + $high=$high->as_hex(); + s%$number%((__int64)$high << 32) /* winemaker:warning: non portable 64 bit number: $value */%g; + } else { + $high=$high->as_hex(); + $low=$low->as_hex(); + s%$number%((__int64)$high << 32 | (__int64)$low) /* winemaker:warning: non portable 64 bit number: $value */%g; + } + } + $again=1; + } + } print FILEO; } }