X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Makefile.PL;h=9a8580b5cfde30b57bfd5cb818153738b5524ec5;hb=5287145983fdaeadb8adadd96292e05e2cda239a;hp=6f4e066506346e41221cd9c6e37449e1bbecda24;hpb=d2c6211cf7de0d0eac95017c4f16c804d73bafee;p=perl%2Fmodules%2FScalar-Vec-Util.git diff --git a/Makefile.PL b/Makefile.PL index 6f4e066..9a8580b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -37,14 +37,24 @@ if ($cc) { my @DEFINES; +sub is_little_endian { + my $order = $Config{byteorder}; + return 0 unless $order; + my $len = length $order; + if ($len > 8) { + $order = substr $order, 0, 8; + $len = 8; + } + return $order eq (join '', 1 .. $len); +} + my $unit = { bits => 8, size => 1 }; -if (unpack("h*", pack("s", 0x1234)) != 4321) { +if (not is_little_endian()) { print "Forcing unit size of 8 on non-little-endian systems.\n"; } else { print "Checking unit size in bits... "; my $align = $Config{alignbytes} || 1; - my @bits = (8, 16, 32); - push @bits, 64 unless $^O eq 'MSWin32'; + my @bits = (8, 16, 32, 64); for my $bits (@bits) { my $size = $Config{"u${bits}size"}; next unless $size;