diff --git a/src/timeshift/timeshift_reader.c b/src/timeshift/timeshift_reader.c index 3701ddee..f2a3b6bc 100644 --- a/src/timeshift/timeshift_reader.c +++ b/src/timeshift/timeshift_reader.c @@ -318,7 +318,7 @@ static int _timeshift_read ts->id, (*cur_file)->path); *fd = open((*cur_file)->path, O_RDONLY); } - tvhtrace("timeshift", "ts %d seek to %lu", ts->id, *cur_off); + tvhtrace("timeshift", "ts %d seek to %"PRIoff_t, ts->id, *cur_off); lseek(*fd, *cur_off, SEEK_SET); /* Read msg */ @@ -329,7 +329,7 @@ static int _timeshift_read tvhlog(LOG_ERR, "timeshift", "ts %d could not read buffer", ts->id); return -1; } - tvhtrace("timeshift", "ts %d read msg %p (%ld)", + tvhtrace("timeshift", "ts %d read msg %p (%"PRIssize_t")", ts->id, *sm, r); /* Incomplete */ diff --git a/src/tvheadend.h b/src/tvheadend.h index f0dbdcd4..55cdd517 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -549,10 +549,22 @@ int rmtree ( const char *path ); char *regexp_escape ( const char *str ); /* printing */ -#if __SIZEOF_LONG__ == 8 - #define PRItime_t PRId64 +# if __WORDSIZE == 64 +#define PRIsword_t PRId64 +#define PRIuword_t PRIu64 #else - #define PRItime_t "l" PRId32 +#define PRIsword_t PRId32 +#define PRIuword_t PRIu32 +#endif +#define PRIslongword_t "ld" +#define PRIulongword_t "lu" +#define PRIsize_t PRIuword_t +#define PRIssize_t PRIsword_t +#define PRItime_t PRIslongword_t +#if _FILE_OFFSET_BITS == 64 +#define PRIoff_t PRId64 +#else +#define PRIoff_t PRIslongword_t #endif #endif /* TV_HEAD_H */