diff mbox

[libffi,testsuite] Provide PRIuPTR, PRI[du]64 for IRIX 6.5

Message ID yddipzltji7.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Nov. 25, 2010, 5:12 p.m. UTC
A couple of libffi tests currently fail to compile on IRIX 6.5 since
various PRI* defines aren't visible.  While they exist in <inttypes.h>,
they are only exposed for C99 compilations, and even if they were, there
are a couple of problems described in comments in the patch.

The following patch fixes this and allows most testcases to succeed.
I've filed

libffi/46660	cls_double_va.c, cls_longdouble_va.c FAIL on IRIX 6.5
libffi/46661	32-bit cls_pointer.c, cls_pointer_stack.c FAIL on IRIX 6.5

for the remaining ones.  Tested with make check, ok for mainline (and an
eventual 4.5 backport)?

Thanks.

	Rainer


2010-11-22  Rainer Orth  <ro@columba.CeBiTec.Uni-Bielefeld.DE>

	* testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define.
	(PRIuPTR): Define.
diff mbox

Patch

diff -r 6fa06fdbdfaa libffi/testsuite/libffi.call/ffitest.h
--- a/libffi/testsuite/libffi.call/ffitest.h	Mon Nov 22 21:05:42 2010 +0100
+++ b/libffi/testsuite/libffi.call/ffitest.h	Thu Nov 25 18:09:57 2010 +0100
@@ -77,6 +77,26 @@ 
 #define PRIuPTR "lu"
 #endif
 
+/* IRIX kludge.  */
+#if defined(__sgi)
+/* IRIX 6.5 <inttypes.h> provides all definitions, but only for C99
+   compilations.  */
+#if (_MIPS_SZLONG == 32)
+#define PRId64 "lld"
+#define PRIu64 "llu"
+#endif
+/* This doesn't match <inttypes.h>, which always has "lld" here, but the
+   arguments are uint64_t, int64_t, which are unsigned long, long for
+   64-bit in <sgidefs.h>.  */
+#if (_MIPS_SZLONG == 64)
+#define PRId64 "ld"
+#define PRIu64 "lu"
+#endif
+/* This doesn't match <inttypes.h>, which has "u" here, but the arguments
+   are uintptr_t, which is always unsigned long.  */
+#define PRIuPTR "lu"
+#endif
+
 /* Solaris < 10 kludge.  */
 #if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
 #if defined(__arch64__) || defined (__x86_64__)