From 0e591504c8a2304227ff02697498d008c745fef4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 4 Aug 2004 21:58:46 +0000 Subject: (LONGEST_MODIFIER): New macro. (PRIuMAX) [!PRI_MACROS_BROKEN && !defined PRIuMAX]: New macro. (find_matching_ancestor): Use it for dev_t and ino_t. --- lib/fts.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/fts.c b/lib/fts.c index 688f8800f..312f56036 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -76,6 +76,17 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #if HAVE_STDINT_H # include #endif +#if ULONG_MAX < ULLONG_MAX +# define LONGEST_MODIFIER "ll" +#else +# define LONGEST_MODIFIER "l" +#endif +#if PRI_MACROS_BROKEN +# undef PRIuMAX +#endif +#ifndef PRIuMAX +# define PRIuMAX LONGEST_MODIFIER "u" +#endif #if defined _LIBC # include @@ -1103,13 +1114,13 @@ find_matching_ancestor (FTSENT const *e_curr, struct Active_dir const *ad) printf ("active dirs:\n"); for (ent = e_curr; ent->fts_level >= FTS_ROOTLEVEL; ent = ent->fts_parent) - printf (" %s(%lu/%lu) to %s(%lu/%lu)...\n", + printf (" %s(%"PRIuMAX"/%"PRIuMAX") to %s(%"PRIuMAX"/%"PRIuMAX")...\n", ad->fts_ent->fts_accpath, - (unsigned long int) ad->dev, - (unsigned long int) ad->ino, + (uintmax_t) ad->dev, + (uintmax_t) ad->ino, ent->fts_accpath, - (unsigned long int) ent->fts_statp->st_dev, - (unsigned long int) ent->fts_statp->st_ino); + (uintmax_t) ent->fts_statp->st_dev, + (uintmax_t) ent->fts_statp->st_ino); } void -- cgit v1.2.3-70-g09d2