Using perl's was needed a long time ago, when packfiles were generated
by perl. It's not needed any more.
So the job is to fix that and use the natural wordsize of the machine:
On (AFAIK) all systems: opcode_type = intval_type = long. This size has
to match the pointer size. And floatval_type = double.
Thanks,
leo
Very small, as it turns out:
- my $intval=$Config{ivtype} || 'long';
- my $floatval=$Config{nvtype} || 'double';
- my $opcode=$Config{ivtype} || 'long';
-
- $intval=$args{intval} if defined $args{intval};
- $floatval=$args{floatval} if defined $args{floatval};
- $opcode=$args{opcode} if defined $args{opcode};
+ my $intval=$args{intval} || 'long';
+ my $floatval=$args{floatval} || 'double';
+ my $opcode=$args{opcode} || 'long';
Committed. All tests pass.
Incidentally, you might be interested in this:
brent@navi/~/parrot$ grep -r '[$@%]Config' config
config/auto/gcc.pl: if($Config{archname} !~ /86/) {
config/auto/gmp.pl: my $archname = $Config{archname};
config/auto/headers.pl: for (keys %Config) {
config/auto/headers.pl: Configure::Data->set($mapping{$_}||$_, $Config{$_});
config/auto/headers.pl: # properly reflected in %Config (i_fcntl
seems to be wrong on my machine,
config/auto/jit.pl: my $archname = $Config{archname};
config/auto/pack.pl: if (($] >= 5.006) && ($size == $longsize) &&
($size == $Config{longsize}) ) {
config/auto/pack.pl: elsif ($size == 8 || $Config{use64bitint} eq
'define') {
config/auto/signal.pl: foreach $name (split(' ', $Config{sig_name})) {
config/init/data.pl: optimize => $optimize ? $Config{optimize} : '',
config/init/data.pl: cc => $Config{cc},
config/init/data.pl: ccflags => $Config{ccflags},
config/init/data.pl: ccwarn => exists($Config{ccwarn}) ?
$Config{ccwarn} : '',
config/init/data.pl: cc_shared => $Config{cccdlflags}, # e.g. -fpic
for GNU cc.
config/init/data.pl: link => $Config{cc},
config/init/data.pl: linkflags => $Config{ldflags},
config/init/data.pl: ld => $Config{ld},
config/init/data.pl: ldflags => $Config{ldflags},
config/init/data.pl: libs => $Config{libs},
config/init/data.pl: exe => $Config{_exe}, #
executable files extension
config/init/data.pl: ld_shared => $Config{lddlflags},
config/init/data.pl: ar => $Config{ar},
config/init/data.pl: ranlib => $Config{ranlib},
config/init/data.pl: make => $Config{make},
config/init/data.pl: make_set_make => $Config{make_set_make},
--
Brent "Dax" Royal-Gordon <br...@brentdax.com>
Perl and Parrot hacker
Oceania has always been at war with Eastasia.
Great, thanks. The patch is smaller then my description ;)
leo
> On (AFAIK) all systems: opcode_type = intval_type = long. This size has
> to match the pointer size. And floatval_type = double.
It was not exactly true till recent (the counter sample is OpenVMS, IIRC), and
is even more incorrect since Win64 goes to the field: both Itanium and Amd64
ports of Windows XP, or 2003 Server use 32-bit sizes for int and long, while
pointers are 64 bit there. So please be prepared...
>
> Thanks,
> leo
>
>
>
Regards,
Timur
Well, yes. The "all systems" above should have been "all currently
implemented ...". The Win64 implementation is sick. Anyway we need
that pointer size matches opcode and intval size.
> Regards,
> Timur
leo