Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solaris 8, 64 bit, UTF8 patch #2856

Closed
p5pRT opened this issue Nov 14, 2000 · 2 comments
Closed

Solaris 8, 64 bit, UTF8 patch #2856

p5pRT opened this issue Nov 14, 2000 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 14, 2000

Migrated from rt.perl.org#4693 (status was 'resolved')

Searchable as RT4693$

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2000

From @jhamisch

Hi,

in a Solaris 64 bit environment, the test t/op/bop fails (APC = 7680).
This is caused by a wrong constant definition in utf8.c and utf8.h.
The value 0x1000000000LL is a real long *SIGNED* value, which gets
compared to an UV.

Sun defines nice macros like UINT64_C, which puts the correct trailer
to the end of constants. I've used these in my patch. Nevertheless
even without these macros, the trailer should be ULL instead of LL,
shouldn't it?!?!?

Regards
-- jens


  /
+##+|##+ STRAWBERRY Jens Hamisch
+v#+v v##+ EDV-Systeme GmbH Managing director
/ v v\v
| . . . | Brauneckweg 2 Car (Voice)​: (+49 172) 81 04 162
| . | D-82549 Koenigsdorf Voice​: (+49 8179) 9305-50
| . | Fax​: (+49 8179) 9305-38
\ . / Tel./Fax​: (+49 8179) 9305-50 Email​: jens@​Strawberry.COM
  \____/ Strawberry@​Strawberry.COM

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2000

From @jhamisch

*** utf8.c.FCS Tue Nov 14 18​:24​:12 2000
--- utf8.c Tue Nov 14 18​:41​:30 2000
***************
*** 69,75 ****
  return d;
  }
  #ifdef HAS_QUAD
! if (uv < 0x1000000000LL)
  #endif
  {
  *d++ = 0xfe; /* Can't match U+FEFF! */
--- 69,75 ----
  return d;
  }
  #ifdef HAS_QUAD
! if (uv < UTF8_QUAD_MAX)
  #endif
  {
  *d++ = 0xfe; /* Can't match U+FEFF! */
*** utf8.h.FCS Tue Nov 14 18​:32​:55 2000
--- utf8.h Tue Nov 14 18​:38​:50 2000
***************
*** 9,14 ****
--- 9,23 ----
 
  START_EXTERN_C
 
+ #ifdef HAS_QUAD
+ # ifdef _LP64
+ # include <inttypes.h>
+ # define UTF8_QUAD_MAX UINT64_C(0x1000000000)
+ # else
+ # define UTF8_QUAD_MAX 0x1000000000LL
+ # endif
+ #endif
+
  #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 */
***************
*** 55,61 ****
  (uv) < 0x200000 ? 4 : \
  (uv) < 0x4000000 ? 5 : \
  (uv) < 0x80000000 ? 6 : \
! (uv) < 0x1000000000LL ? 7 : 13 )
  #else
  /* No, I'm not even going to *TRY* putting #ifdef inside a #define */
  #define UNISKIP(uv) ( (uv) < 0x80 ? 1 : \
--- 64,70 ----
  (uv) < 0x200000 ? 4 : \
  (uv) < 0x4000000 ? 5 : \
  (uv) < 0x80000000 ? 6 : \
! (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 : \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant