This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [patch] Fix libffi.call/cls_align_pointer.c on Solaris < 10
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Fri, 11 Dec 2009 22:43:16 +0100
- Subject: Re: [patch] Fix libffi.call/cls_align_pointer.c on Solaris < 10
- References: <200912110950.47092.ebotcazou@adacore.com>
Eric Botcazou <ebotcazou@adacore.com> writes:
> libffi.call/cls_align_pointer.c fails to compile on Solaris < 10 because
> PRIuPTR is not defined. Hence the attached kludge.
>
> Tested on SPARC/Solaris 9 and SPARC/Solaris 10, OK for mainline?
>
>
> 2009-12-11 Eric Botcazou <ebotcazou@adacore.com>
>
> * testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10.
[...]
> +/* Solaris < 10 kludge. */
> +#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
> +#if defined(__arch64__) || defined (__x86_64__)
> +#define PRIuPTR "lu"
> +#else
> +#define PRIuPTR "u"
> +#endif
> +#endif
The same problem exists on other platforms as well, e.g. Tru64 UNIX
V4.0F (which even lacks %lld/%llu support in libc, but has 64-bit long)
and V5.1B (which has %lld/%llu, but lacks the C99 PRI* macros). Cf. PR
libffi/40701.
This seems to call for a more general solution than this hack, probably
along the lines of intl/loadmsgcat.c.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University