diff options
author | Joel Sherrill <joel@rtems.org> | 2017-04-22 14:15:22 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2017-04-22 14:15:22 -0500 |
commit | 438ca2f5944082fc1851bdec8834b86173a0fc82 (patch) | |
tree | 9e8c2a12e940e25c1ff10eb3d79eb92595d30cb4 /cpukit/include/rtems/inttypes.h | |
parent | elnk.c: Fix printf() format warnings (diff) | |
download | rtems-438ca2f5944082fc1851bdec8834b86173a0fc82.tar.bz2 |
rtems/inttypes.h: Add blksize_t and blkcnt_t
Diffstat (limited to 'cpukit/include/rtems/inttypes.h')
-rw-r--r-- | cpukit/include/rtems/inttypes.h | 22 |
1 files changed, 22 insertions, 0 deletions
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. |