summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-05-04 21:30:27 +0200
committerNicholas Clark <nick@ccl4.org>2013-05-20 21:19:42 +0200
commit260c6fee6deba90b42b0734fbdea2fea1d69c9bc (patch)
tree73c3ec33822c5afeeac227af7bfd825740250b76 /pp_pack.c
parent5ae724797a32a9a98d51759460d87f419fdd5a45 (diff)
downloadperl-260c6fee6deba90b42b0734fbdea2fea1d69c9bc.tar.gz
Provide vtohl, vtohs, htovl and htovs no-op macros on little endian systems.
This means that there are always macros or functions for vtohl, vtohs, htovl and htovs available, so eliminate HAS_VTOHL etc, and unconditionally compile the code that it was protecting. grep.cpan.me shows that no code on CPAN uses any of these macros. (Technically the 4 are not quite no-ops, as they truncate their values to 32 or 16 bits, to be consistent with the implementations for platforms which need re-ordering.)
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/pp_pack.c b/pp_pack.c
index e9969d51d3..b47df9b8b2 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -1480,10 +1480,8 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c
if (datumtype == 'n')
au16 = PerlSock_ntohs(au16);
#endif
-#ifdef HAS_VTOHS
if (datumtype == 'v')
au16 = vtohs(au16);
-#endif
if (!checksum)
mPUSHu(au16);
else if (checksum > bits_in_uv)
@@ -1504,10 +1502,8 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c
if (datumtype == ('n' | TYPE_IS_SHRIEKING))
ai16 = (I16) PerlSock_ntohs((U16) ai16);
# endif /* HAS_NTOHS */
-# ifdef HAS_VTOHS
if (datumtype == ('v' | TYPE_IS_SHRIEKING))
ai16 = (I16) vtohs((U16) ai16);
-# endif /* HAS_VTOHS */
if (!checksum)
mPUSHi(ai16);
else if (checksum > bits_in_uv)
@@ -1653,10 +1649,8 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c
if (datumtype == 'N')
au32 = PerlSock_ntohl(au32);
#endif
-#ifdef HAS_VTOHL
if (datumtype == 'V')
au32 = vtohl(au32);
-#endif
if (!checksum)
mPUSHu(au32);
else if (checksum > bits_in_uv)
@@ -1677,10 +1671,8 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c
if (datumtype == ('N' | TYPE_IS_SHRIEKING))
ai32 = (I32)PerlSock_ntohl((U32)ai32);
#endif
-#ifdef HAS_VTOHL
if (datumtype == ('V' | TYPE_IS_SHRIEKING))
ai32 = (I32)vtohl((U32)ai32);
-#endif
if (!checksum)
mPUSHi(ai32);
else if (checksum > bits_in_uv)
@@ -2883,9 +2875,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist )
I16 ai16;
fromstr = NEXTFROM;
ai16 = (I16)SvIV(fromstr);
-#ifdef HAS_HTOVS
ai16 = htovs(ai16);
-#endif
PUSH16(utf8, cur, &ai16);
}
break;
@@ -3092,9 +3082,7 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist )
U32 au32;
fromstr = NEXTFROM;
au32 = SvUV(fromstr);
-#ifdef HAS_HTOVL
au32 = htovl(au32);
-#endif
PUSH32(utf8, cur, &au32);
}
break;