From 4f1b10827b81cd9acaa9e02b0da0dc447f1471ea Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Wed, 12 Sep 2012 16:38:33 +0200 Subject: introduce PRIxoff_t and PRIdoff_t printf helpers They will be usefull when printing offsets. Signed-off-by: Richard Genoud Signed-off-by: Artem Bityutskiy --- include/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/common.h b/include/common.h index 88b67e5..d0c4146 100644 --- a/include/common.h +++ b/include/common.h @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include "version.h" #ifndef PROGRAM_NAME @@ -48,6 +50,15 @@ extern "C" { #define O_CLOEXEC 0 #endif +/* define a print format specifier for off_t */ +#ifdef __USE_FILE_OFFSET64 +#define PRIxoff_t PRIx64 +#define PRIdoff_t PRId64 +#else +#define PRIxoff_t "l"PRIx32 +#define PRIdoff_t "l"PRId32 +#endif + /* Verbose messages */ #define bareverbose(verbose, fmt, ...) do { \ if (verbose) \ -- cgit v1.2.3