This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
When endian-swapping in unpack, simply copy the bytes in reverse order.
authorNicholas Clark <nick@ccl4.org>
Tue, 7 May 2013 13:15:54 +0000 (15:15 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 20 May 2013 19:19:44 +0000 (21:19 +0200)
commit20aa3a3813ca2068a61ea9582e99df57cc735e62
tree2f8d682528d6ae8b86cf284bffd78794f766126c
parentcd7e75121be11e7979933a8f7a47cd842a685157
When endian-swapping in unpack, simply copy the bytes in reverse order.

It is considerably simpler to re-order the bytes before reading them into
the variable of the desired type, than to read into the variable and then
need a specialised "reverse this integer" function for each size of integer.

This should restore support for big endian Crays. It doesn't support
mixed-endian systems. Support for mixed-endian systems can be restored (if
needed) by re-ordering the bytes correctly at the locations which currently
only know how to reverse the bytes.
pp_pack.c