Pb compiling gcj ct'd

Martin v. Loewis martin@mira.isdn.cs.tu-berlin.de
Thu May 13 10:48:00 GMT 1999


> Is __uint32_t or __int32_t defined somewhere on your system?

I just ran into the same problem; it happens on glibc 2.1 systems.
java/lang/mprec.h has

#ifndef HAVE_INT32_DEFINED
typedef int __int32_t;
typedef unsigned int __uint32_t;
#endif

HAVE_INT32_DEFINED is defined if configure detected it in sys/types.h
or sys/config.h. However, neither is included at this point. I fixed
this (for Linux) with

#ifndef HAVE_INT32_DEFINED
typedef int __int32_t;
typedef unsigned int __uint32_t;
#else
#include <sys/types.h>
#endif

which would allow to compile libgcj. I think the right procedure is:

- Check whether stdint.h is present. You then have a C99 system, and
  you can use int32_t and uint32_t.
- __int32_t and __uint32_t are reserved for the implementation (of C),
  so use something else (like gcj_int32)
- If there are systems that predefine __int32_t and don't have
  <stdint.h>, add additional macros HAVE_INT32_IN_SYS_TYPES and
  HAVE_INT32_IN_SYS_CONFIG

Doesn't autoconf support some magic for finding a proper primitive
type for a given bit size?

Regards,
Martin


More information about the Java mailing list