diff options
Diffstat (limited to 'support/timespec.c')
-rw-r--r-- | support/timespec.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/support/timespec.c b/support/timespec.c index f1b88c1f4c..653293970a 100644 --- a/support/timespec.c +++ b/support/timespec.c @@ -18,6 +18,7 @@ #include <support/timespec.h> #include <stdio.h> +#include <stdint.h> void test_timespec_before_impl (const char *file, int line, @@ -29,12 +30,12 @@ test_timespec_before_impl (const char *file, int line, && left.tv_nsec > right.tv_nsec)) { support_record_failure (); const struct timespec diff = timespec_sub (left, right); - printf ("%s:%d: %ld.%09lds not before %ld.%09lds " - "(difference %ld.%09lds)n", + printf ("%s:%d: %jd.%09jds not before %jd.%09jds " + "(difference %jd.%09jds)n", file, line, - left.tv_sec, left.tv_nsec, - right.tv_sec, right.tv_nsec, - diff.tv_sec, diff.tv_nsec); + (intmax_t) left.tv_sec, (intmax_t) left.tv_nsec, + (intmax_t) right.tv_sec, (intmax_t) right.tv_nsec, + (intmax_t) diff.tv_sec, (intmax_t) diff.tv_nsec); } } @@ -48,11 +49,11 @@ test_timespec_equal_or_after_impl (const char *file, int line, && left.tv_nsec < right.tv_nsec)) { support_record_failure (); const struct timespec diff = timespec_sub (right, left); - printf ("%s:%d: %ld.%09lds not after %ld.%09lds " - "(difference %ld.%09lds)n", + printf ("%s:%d: %jd.%09jds not after %jd.%09jds " + "(difference %jd.%09jds)n", file, line, - left.tv_sec, left.tv_nsec, - right.tv_sec, right.tv_nsec, - diff.tv_sec, diff.tv_nsec); + (intmax_t) left.tv_sec, (intmax_t) left.tv_nsec, + (intmax_t) right.tv_sec, (intmax_t) right.tv_nsec, + (intmax_t) diff.tv_sec, (intmax_t) diff.tv_nsec); } } |