summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2011-02-08 06:38:04 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2011-02-08 06:38:04 +0000
commit1ebe3da136ef7a6db74cbca608bda5d110af9a8b (patch)
tree0c7994b9da56935078727e79f1f794b4fb13c488
parent664db16fd83076cfb744b7d42ba42c1a7c7a2aca (diff)
2011-02-08 Ralf Corsépius <ralf.corsepius@rtems.org>
* include/pmacros.h: Add PRIxblksize_t, PRIxblkcnt_t. * configure.ac: Add AC_CHECK_SIZEOF([blksize_t]), AC_CHECK_SIZEOF([blkcnt_t]).
-rw-r--r--testsuites/psxtests/configure.ac2
-rw-r--r--testsuites/psxtests/include/pmacros.h20
2 files changed, 22 insertions, 0 deletions
diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac
index 07e6827998..c001e74bca 100644
--- a/testsuites/psxtests/configure.ac
+++ b/testsuites/psxtests/configure.ac
@@ -55,6 +55,8 @@ AC_CHECK_DECLS([mprotect],[],[],[[#include <sys/mman.h>]])
# FIXME: We should get rid of this. It's a cludge.
AC_CHECK_SIZEOF([off_t])
+AC_CHECK_SIZEOF([blksize_t])
+AC_CHECK_SIZEOF([blkcnt_t])
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile
diff --git a/testsuites/psxtests/include/pmacros.h b/testsuites/psxtests/include/pmacros.h
index 378e93a6e9..921f33a271 100644
--- a/testsuites/psxtests/include/pmacros.h
+++ b/testsuites/psxtests/include/pmacros.h
@@ -101,6 +101,26 @@
#error "unsupported size of off_t"
#endif
+#if SIZEOF_BLKSIZE_T == 8
+#define PRIxblksize_t PRIx64
+#elif SIZEOF_BLKSIZE_T == 4
+#define PRIxblksize_t PRIx32
+#else
+/* Warn and fall back to "long" */
+#warning "unsupported size of blksize_t"
+#define PRIxblksize_t "lx"
+#endif
+
+#if SIZEOF_BLKSIZE_T == 8
+#define PRIxblkcnt_t PRIx64
+#elif SIZEOF_BLKSIZE_T == 4
+#define PRIxblkcnt_t PRIx32
+#else
+/* Warn and fall back to "long" */
+#warning "unsupported size of blkcnt_t"
+#define PRIxblkcnt_t "lx"
+#endif
+
#endif
/* end of file */