From 5c16b21f44c3f035c87ad7fcb3df868700960a39 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Fri, 14 Sep 2018 08:27:44 +0000 Subject: PRI_64_PREFIX "u" is called PRIu64 See also ISO9899:1999 section 7.8.1 paragraph 3. The #ifndef is for C compilers older than C99. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index d138deea98..b4baff6cba 100644 --- a/thread.c +++ b/thread.c @@ -1203,6 +1203,9 @@ COMPILER_WARNING_PUSH #if defined(__GNUC__) && __GNUC__ == 7 && __GNUC_MINOR__ <= 3 COMPILER_WARNING_IGNORED(-Wmaybe-uninitialized) #endif +#ifndef PRIu64 +#define PRIu64 PRI_64_PREFIX "u" +#endif /* * @end is the absolute time when @ts is set to expire * Returns true if @end has past @@ -1215,7 +1218,7 @@ hrtime_update_expire(rb_hrtime_t *timeout, const rb_hrtime_t end) if (now > end) return 1; thread_debug("hrtime_update_expire: " - "%"PRI_64_PREFIX"u > %"PRI_64_PREFIX"u\n", + "%"PRIu64" > %"PRIu64"\n", (uint64_t)end, (uint64_t)now); *timeout = end - now; return 0; -- cgit v1.2.3