From 700b9116a80ae8457538e2c617ddb715ac54abaf Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Sat, 29 May 2010 05:31:46 +0000 Subject: [PATCH] =?UTF-8?q?2010-05-29=09Ralf=20Cors=C3=A9pius=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * configure.ac: Add AC_CHECK_SIZEOF(off_t). * include/pmacros.h: Add PRIdoff_t. --- testsuites/psxtests/configure.ac | 3 +++ testsuites/psxtests/include/pmacros.h | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac index 976b1b6088..01d8201b79 100644 --- a/testsuites/psxtests/configure.ac +++ b/testsuites/psxtests/configure.ac @@ -53,6 +53,9 @@ AC_CHECK_DECLS([adjtime],[],[],[[#include ]]) # RTEMS provides a stub, despite newlib doesn't have sys/mman.h AC_CHECK_DECLS([mprotect],[],[],[[#include ]]) +# FIXME: We should get rid of this. It's a cludge. +AC_CHECK_SIZEOF([off_t]) + # Explicitly list all Makefiles here AC_CONFIG_FILES([Makefile psx01/Makefile diff --git a/testsuites/psxtests/include/pmacros.h b/testsuites/psxtests/include/pmacros.h index be9f35c8e5..378e93a6e9 100644 --- a/testsuites/psxtests/include/pmacros.h +++ b/testsuites/psxtests/include/pmacros.h @@ -93,6 +93,14 @@ #define empty_line() puts( "" ) +#if SIZEOF_OFF_T == 8 +#define PRIdoff_t PRIo64 +#elif SIZEOF_OFF_T == 4 +#define PRIdoff_t PRIo32 +#else +#error "unsupported size of off_t" +#endif + #endif /* end of file */