From 438ca2f5944082fc1851bdec8834b86173a0fc82 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sat, 22 Apr 2017 14:15:22 -0500 Subject: rtems/inttypes.h: Add blksize_t and blkcnt_t --- cpukit/include/rtems/inttypes.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'cpukit/include/rtems/inttypes.h') diff --git a/cpukit/include/rtems/inttypes.h b/cpukit/include/rtems/inttypes.h index ef02ccff4a..023353fe40 100644 --- a/cpukit/include/rtems/inttypes.h +++ b/cpukit/include/rtems/inttypes.h @@ -70,6 +70,28 @@ extern "C" { #error "PRIdtime_t: unsupported size of time_t" #endif +/** Helper macro to print "blksize_t" in decimal */ +#if __RTEMS_SIZEOF_BLKSIZE_T__ == 8 +#define PRIxblksize_t PRIx64 +#elif __RTEMS_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 + +/** Helper macro to print "blkcnt_t" in decimal */ +#if __RTEMS_SIZEOF_BLKCNT_T__ == 8 +#define PRIxblkcnt_t PRIx64 +#elif __RTEMS_SIZEOF_BLKCNT_T__ == 4 +#define PRIxblkcnt_t PRIx32 +#else +/* Warn and fall back to "long" */ +#warning "unsupported size of blkcnt_t" +#define PRIxblkcnt_t "lx" +#endif + /* * Various inttypes.h-stype macros to assist printing * certain system types on different targets. -- cgit v1.2.3