On Mon, Nov 02, 1998 at 01:35:59PM -0800, Charles Stephens wrote:
I seem to have problems compiling XEmacs 21 (or 20.4 for that matter)
on SunOS 5.7 with the 64-bit compiler.
It seems that in several places in the code, XEmacs makes assumptions
about the size of int's and long's and it assumes they are same size.
No it doesn't. It compiles out of the box on alpha and on irix 6.x in
64bits mode. I tracked and killed a bunch of 64bits related bugs, and
I have seen no related bug report for a while (which does not mean I
caught them all, of course).
Here is an example from lisp.h:
#if (LONGBITS > INTBITS)
# define EMACS_INT long
# define EMACS_UINT unsigned long
# define SIZEOF_EMACS_INT SIZEOF_LONG
#else# define EMACS_INT int
# define EMACS_UINT unsigned int
# define SIZEOF_EMACS_INT SIZEOF_INT
#endif
This means "an EMACS_INT is the biggest on int and long", i.e. a
32bits integer on 32bits architectures and a 64bits one elsewhere.
#if (LONGBITS < 16)
#error What the hell?!
#elif (LONGBITS < 32)
# define LONGBITS_LOG2 4
# define LONGBITS_POWER_OF_2 16
#elif (LONGBITS < 64)
# define LONGBITS_LOG2 5
# define LONGBITS_POWER_OF_2 32
#elif (LONGBITS < 128)
# define LONGBITS_LOG2 6
# define LONGBITS_POWER_OF_2 64
#else
#error You really have 128-bit integers?!#endif
INLINE int
bit_vector_bit (struct Lisp_Bit_Vector *v, int i)
{
unsigned int ui = (unsigned int) i;
return (((v)->bits[ui >> LONGBITS_LOG2] >> (ui &
(LONGBITS_POWER_OF_2 - 1)))
& 1);
}
While Lisp_Bit_Vector::bits is declared as an int array for alignment
purposes, which is arguably a bug but not a real problem (because of
the long size preceding it, and the alignment requirements of sizeof),
they really are allocated as longs. This code is correct, and I'm
sending a patch for the declaration.
The end result is that temacs goes off to visit Elvis when it is
trying to do the dynodump.
Dynodump, being sun specific, has afaik never been tested on a 64bits
architecture. The problem probably lies there. I don't think anybody
here has the required hardware to fix it, so all I can say is good
luck. But you can trust the common code for 64bits cleanliness.
OG.