This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use UINT64_C().
authorJens Hamisch <jens@Strawberry.COM>
Tue, 14 Nov 2000 19:16:23 +0000 (20:16 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 15 Nov 2000 02:20:12 +0000 (02:20 +0000)
Subject: [ID 20001114.006] 5.7.0-7680 Solaris 8, 64 bit, utf8 patch
Message-Id: <20001114191623.G20559@Strawberry.COM>

p4raw-id: //depot/perl@7691

utf8.c
utf8.h

diff --git a/utf8.c b/utf8.c
index a54726f..5d0fdc6 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -69,7 +69,7 @@ Perl_uv_to_utf8(pTHX_ U8 *d, UV uv)
        return d;
     }
 #ifdef HAS_QUAD
-    if (uv < 0x1000000000LL)
+    if (uv < UTF8_QUAD_MAX)
 #endif
     {
        *d++ =                        0xfe;     /* Can't match U+FEFF! */
diff --git a/utf8.h b/utf8.h
index 269ad3e..522f4a9 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -9,6 +9,8 @@
 
 START_EXTERN_C
 
+#include "handy.h"
+
 #ifdef DOINIT
 EXTCONST unsigned char PL_utf8skip[] = {
 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ascii */
@@ -48,6 +50,8 @@ END_EXTERN_C
 
 #define UTF8SKIP(s) PL_utf8skip[*(U8*)s]
 
+#define UTF8_QUAD_MAX  UINT64_C(0x1000000000)
+
 #ifdef HAS_QUAD
 #define UNISKIP(uv) ( (uv) < 0x80           ? 1 : \
                      (uv) < 0x800          ? 2 : \
@@ -55,7 +59,7 @@ END_EXTERN_C
                      (uv) < 0x200000       ? 4 : \
                      (uv) < 0x4000000      ? 5 : \
                      (uv) < 0x80000000     ? 6 : \
-                      (uv) < 0x1000000000LL ? 7 : 13 ) 
+                      (uv) < UTF8_QUAD_MAX ? 7 : 13 ) 
 #else
 /* No, I'm not even going to *TRY* putting #ifdef inside a #define */
 #define UNISKIP(uv) ( (uv) < 0x80           ? 1 : \