summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perl.h8
-rw-r--r--pp.c14
2 files changed, 13 insertions, 9 deletions
diff --git a/perl.h b/perl.h
index f5841e61c8..ca8973e3bc 100644
--- a/perl.h
+++ b/perl.h
@@ -855,6 +855,7 @@ Free_t Perl_free _((Malloc_t where));
#ifndef Quad_t
# if LONGSIZE == 8
# define Quad_t long
+# define Uquad_t unsigned long
# define PERL_QUAD_IS_LONG
# endif
#endif
@@ -862,6 +863,7 @@ Free_t Perl_free _((Malloc_t where));
#ifndef Quad_t
# if INTSIZE == 8
# define Quad_t int
+# define Uquad_t unsigned int
# define PERL_QUAD_IS_INT
# endif
#endif
@@ -870,6 +872,7 @@ Free_t Perl_free _((Malloc_t where));
# ifdef USE_LONG_LONG /* See above note about LP32. --jhi */
# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8
# define Quad_t long long
+# define Uquad_t unsigned long long
# define PERL_QUAD_IS_LONG_LONG
# endif
# endif
@@ -886,8 +889,9 @@ Free_t Perl_free _((Malloc_t where));
#ifdef Quad_t
# define HAS_QUAD
# ifndef Uquad_t
- /* Note that if your Quad_t is a typedef you *must* have defined
- * also Uquad_t yourself because 'unsigned type' is illegal. */
+ /* Note that if your Quad_t is a typedef (not a #define) you *MUST*
+ * have defined by now Uquad_t yourself because 'unsigned type'
+ * is illegal. */
# define Uquad_t unsigned Quad_t
# endif
#endif
diff --git a/pp.c b/pp.c
index 6a308a868f..2686116698 100644
--- a/pp.c
+++ b/pp.c
@@ -3203,7 +3203,7 @@ PP(pp_unpack)
unsigned int auint;
U32 aulong;
#ifdef HAS_QUAD
- unsigned Quad_t auquad;
+ Uquad_t auquad;
#endif
char *aptr;
float afloat;
@@ -3760,11 +3760,11 @@ PP(pp_unpack)
EXTEND(SP, len);
EXTEND_MORTAL(len);
while (len-- > 0) {
- if (s + sizeof(unsigned Quad_t) > strend)
+ if (s + sizeof(Uquad_t) > strend)
auquad = 0;
else {
- Copy(s, &auquad, 1, unsigned Quad_t);
- s += sizeof(unsigned Quad_t);
+ Copy(s, &auquad, 1, Uquad_t);
+ s += sizeof(Uquad_t);
}
sv = NEWSV(43, 0);
if (auquad <= UV_MAX)
@@ -4051,7 +4051,7 @@ PP(pp_pack)
U32 aulong;
#ifdef HAS_QUAD
Quad_t aquad;
- unsigned Quad_t auquad;
+ Uquad_t auquad;
#endif
char *aptr;
float afloat;
@@ -4438,8 +4438,8 @@ PP(pp_pack)
case 'Q':
while (len-- > 0) {
fromstr = NEXTFROM;
- auquad = (unsigned Quad_t)SvIV(fromstr);
- sv_catpvn(cat, (char*)&auquad, sizeof(unsigned Quad_t));
+ auquad = (Uquad_t)SvIV(fromstr);
+ sv_catpvn(cat, (char*)&auquad, sizeof(Uquad_t));
}
break;
case 'q':