From: "H.Yamamoto" Date: 2006-02-16T17:45:50+09:00 Subject: Re: pack("l"), 64 bit question Hello. >This means EXTEND32() macro in pack.c is not working on 64bit Solaris >(and perhaps on other 64bit systems neither). I have no 64bit machine >at hand. Could somebody confirm? Me neigher. But we can use HP TestDrive :-) Probably this patch will solve the problem. Index: pack.c =================================================================== RCS file: /src/ruby/pack.c,v retrieving revision 1.62.2.12 diff -u -w -b -p -r1.62.2.12 pack.c --- pack.c 13 Oct 2005 14:30:49 -0000 1.62.2.12 +++ pack.c 16 Feb 2006 06:01:07 -0000 @@ -347,11 +347,11 @@ num2i32(x) return 0; /* not reached */ } -#if SIZEOF_LONG == SIZE32 || SIZEOF_INT == SIZE32 +#if SIZEOF_LONG == SIZE32 # define EXTEND32(x) #else /* invariant in modulo 1<<31 */ -# define EXTEND32(x) do {if (!natint) {(x) = (I32)(((1<<31)-1-(x))^~(~0<<31));}} while(0) +# define EXTEND32(x) do { if (!natint) {(x) = (((1L<<31)-1-(x))^~(~0L<<31));}} while(0) #endif #if SIZEOF_SHORT == SIZE16 # define EXTEND16(x)