summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-05-06 16:54:12 +0200
committerNicholas Clark <nick@ccl4.org>2013-05-20 21:19:43 +0200
commit68a0946fb4222dd6bcf5c2881bf6cd64c2c2e5ef (patch)
tree549204df66d5ac5f8e7fb2180a8ae06d351c98e0 /pp_pack.c
parent86c6fce076648c5abe5ab491fec9d3142d93bde1 (diff)
downloadperl-68a0946fb4222dd6bcf5c2881bf6cd64c2c2e5ef.tar.gz
In pp_pack.c, refactor DO_BO_(UN)?PACK to use my_letohn etc
Previously they were using a my_letoh* function for the appropriate size. This commit probably breaks fixed 16 and 32 bit templates on big endian Crays where sizeof(short) and sizeof(int) are 8. A future commit will restore support. (Although it's not clear whether such Crays can still build blead cleanly, as we've not had any feedback since Boeing decommissioned their Cray.)
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pp_pack.c b/pp_pack.c
index 2967598f4d..8e08c0c118 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -242,14 +242,14 @@ S_mul128(pTHX_ SV *sv, U8 m)
# define DO_BO_UNPACK(var, type) \
STMT_START { \
if (TYPE_ENDIANNESS(datumtype) == TYPE_IS_LITTLE_ENDIAN) { \
- var = my_letoh ## type (var); \
+ my_letohn(&var, sizeof(var)); \
} \
} STMT_END
# define DO_BO_PACK(var, type) \
STMT_START { \
if (TYPE_ENDIANNESS(datumtype) == TYPE_IS_LITTLE_ENDIAN) { \
- var = my_htole ## type (var); \
+ my_htolen(&var, sizeof(var)); \
} \
} STMT_END
@@ -286,14 +286,14 @@ S_mul128(pTHX_ SV *sv, U8 m)
# define DO_BO_UNPACK(var, type) \
STMT_START { \
if (TYPE_ENDIANNESS(datumtype) == TYPE_IS_BIG_ENDIAN) { \
- var = my_betoh ## type (var); \
+ my_betohn(&var, sizeof(var)); \
} \
} STMT_END
# define DO_BO_PACK(var, type) \
STMT_START { \
if (TYPE_ENDIANNESS(datumtype) == TYPE_IS_BIG_ENDIAN) { \
- var = my_htobe ## type (var); \
+ my_htoben(&var, sizeof(var)); \
} \
} STMT_END