This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
vtohl, vtohs, htovl and htovs are no-ops on 64 bit little endian systems.
authorNicholas Clark <nick@ccl4.org>
Sat, 4 May 2013 19:07:14 +0000 (21:07 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 20 May 2013 19:19:42 +0000 (21:19 +0200)
Previously they were implemented as function calls on 64 bit little endian
systems. Bit endian systems implemented them as byte-swapping macros. 32
little endian system didn't implement them at all. 32 and 64 bit little
endian systems now behave identically.

perl.h

diff --git a/perl.h b/perl.h
index dc5e411..a0feae2 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -3561,7 +3561,9 @@ struct ptr_tbl {
  * Little-endian byte order functions - 'v' for 'VAX', or 'reVerse'.
  * -DWS
  */
-#if BYTEORDER != 0x1234
+#if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678
+/* Little endian system, so vtohl, vtohs, htovl and htovs are all no-ops.  */
+#else
 # define HAS_VTOHL
 # define HAS_VTOHS
 # define HAS_HTOVL