/* pp.c
*
- * Copyright (c) 1991-1997, Larry Wall
+ * Copyright (c) 1991-1999, Larry Wall
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
#define SIZE16 2
#define SIZE32 4
+/* CROSSCOMPILE and MULTIARCH are going to affect pp_pack() and pp_unpack().
+ --jhi Feb 1999 */
+
#if SHORTSIZE != SIZE16 || LONGSIZE != SIZE32
# define PERL_NATINT_PACK
#endif
#endif
if (isSPACE(datumtype))
continue;
- if (*pat == '_') {
+ if (*pat == '!') {
char *natstr = "sSiIlL";
if (strchr(natstr, datumtype)) {
pat++;
}
else
- croak("'_' allowed only after types %s", natstr);
+ croak("'!' allowed only after types %s", natstr);
}
if (pat >= patend)
len = 1;
{
while (len-- > 0) {
COPY16(s, &ashort);
+#if SHORTSIZE > SIZE16
+ if (ashort > 32767)
+ ashort -= 65536;
+#endif
s += SIZE16;
culong += ashort;
}
{
while (len-- > 0) {
COPY16(s, &ashort);
+#if SHORTSIZE > SIZE16
+ if (ashort > 32767)
+ ashort -= 65536;
+#endif
s += SIZE16;
sv = NEWSV(38, 0);
sv_setiv(sv, (IV)ashort);
{
while (len-- > 0) {
COPY32(s, &along);
+#if LONGSIZE > SIZE32
+ if (along > 2147483647)
+ along -= 4294967296;
+#endif
s += SIZE32;
if (checksum > 32)
cdouble += (double)along;
{
while (len-- > 0) {
COPY32(s, &along);
+#if LONGSIZE > SIZE32
+ if (along > 2147483647)
+ along -= 4294967296;
+#endif
s += SIZE32;
sv = NEWSV(42, 0);
sv_setiv(sv, (IV)along);
#endif
if (isSPACE(datumtype))
continue;
- if (*pat == '_') {
+ if (*pat == '!') {
char *natstr = "sSiIlL";
if (strchr(natstr, datumtype)) {
pat++;
}
else
- croak("'_' allowed only after types %s", natstr);
+ croak("'!' allowed only after types %s", natstr);
}
if (*pat == '*') {
len = strchr("@Xxu", datumtype) ? 0 : items;
}
break;
case 's':
-#if SHORTSIZE != 2
+#if SHORTSIZE != SIZE16
if (natint) {
while (len-- > 0) {
fromstr = NEXTFROM;