From: Gurusamy Sarathy Date: Tue, 23 Apr 2002 21:32:03 +0000 (+0000) Subject: hacking around byteorder variance between config.sh and config.h X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e05321a691e9ea6133713ebfcecc5e0fa6ff56d1;p=p5sagit%2Fp5-mst-13.2.git hacking around byteorder variance between config.sh and config.h isn't needed after change#16099 p4raw-link: @16099 on //depot/perl: 244120070b43c8b75f213eed19655d6f4e6e2513 p4raw-id: //depot/perl@16110 --- diff --git a/ext/Storable/t/malice.t b/ext/Storable/t/malice.t index 15871b9..54c0ea4 100644 --- a/ext/Storable/t/malice.t +++ b/ext/Storable/t/malice.t @@ -30,36 +30,17 @@ sub BEGIN { } use strict; -use vars qw($file_magic_str $other_magic $network_magic $major $minor - $C_visible_byteorder); - -BEGIN { -# Config.pm does games to figure out byteorder dynamically. In the process -# it creates an 8 digit entry on long long builds on 32 bit long systems. -# config.sh, config.h and therefore Storable.xs have a 4 digit entry. -$C_visible_byteorder = $Config{byteorder}; -if ($^O ne 'MSWin32' and $Config{longsize} != $Config{ivsize}) { - if ($C_visible_byteorder =~ /^1234/) { - # Little endian - substr ($C_visible_byteorder, $Config{longsize}) = ''; - } elsif ($C_visible_byteorder =~ /4321$/) { - # Big endian - $C_visible_byteorder = substr ($C_visible_byteorder, -$Config{longsize}); - } else { - die "longs are $Config{longsize} bytes, IVs are $Config{ivsize}, byte order $C_visible_byteorder not regonised"; - } -} -} +use vars qw($file_magic_str $other_magic $network_magic $major $minor); # header size depends on the size of the byteorder string $file_magic_str = 'pst0'; -$other_magic = 7 + length($C_visible_byteorder); +$other_magic = 7 + length($Config{byteorder}); $network_magic = 2; $major = 2; $minor = 5; use Test; -BEGIN { plan tests => 334 + length($C_visible_byteorder) * 4} +BEGIN { plan tests => 334 + length($Config{byteorder}) * 4} use Storable qw (store retrieve freeze thaw nstore nfreeze); @@ -90,7 +71,7 @@ sub test_header { ok (1, 1, "Network order header has no sizes"); } } else { - ok ($header->{byteorder}, $C_visible_byteorder, "byte order"); + ok ($header->{byteorder}, $Config{byteorder}, "byte order"); ok ($header->{intsize}, $Config{intsize}, "int size"); ok ($header->{longsize}, $Config{longsize}, "long size"); ok ($header->{ptrsize}, $Config{ptrsize}, "long size");