git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH jk/config-int-range-check] compat/mingw.h: define PRId64

From
Jeff King <peff@peff.net>
Date
Sep 19, 2013, 07:56 UTC
Message-ID
<20130919075610.GB29773@sigill.intra.peff.net>
In-Reply-To
<523AA4F3.6010406@viscovery.net>
On Thu, Sep 19, 2013 at 09:17:07AM +0200, Johannes Sixt wrote:
Show 5 quoted lines
> From: Johannes Sixt <j6t@kdbg.org>
> 
> Provide PRId64 alongside PRIuMAX.
> 
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Thanks. I had noticed this was the first use of PRId64, but I wasn't sure what various implementations would want.

I notice that we also have a fallback PRIuMAX of "llu" in git-compat-util.h, but I'm not sure which platforms need that, nor what they would want for PRId64. By the explanation in 3efb1f3 and e326bce, it looks like the strategy was to just use a "long long" and hope for the best. So we might want:

diff --git a/git-compat-util.h b/git-compat-util.h
index 9549de6..4438e7c 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -239,6 +239,10 @@ extern char *gitbasename(char *);
 #define PRIuMAX "llu"
 #endif
 
+#ifndef PRId64
+#define PRId64 "lld"
+#endif
+
 #ifndef PRIu32
 #define PRIu32 "u"
 #endif

as well, but I think I'd rather wait until somebody with an actual
system that needs it reports in (and tells us what the right value for
their system is) as opposed to just guessing.

-Peff
Previous: Johannes Sixt
Message 2 of 2 in “compat/mingw.h: define PRId64”
  1. compat/mingw.h: define PRId64Johannes Sixt, Sep 19, 2013
  2. Jeff KingSep 19, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.