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... ";