]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/misc.c (make_lltoa): Use printf format macro from makeint.h
authorPaul Smith <psmith@gnu.org>
Mon, 3 Oct 2022 19:10:37 +0000 (15:10 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 3 Oct 2022 19:11:57 +0000 (15:11 -0400)
(make_ulltoa): Ditto.

src/misc.c

index 48e4cb5e8bc174cfca58317c375ccd0170f2f81b..011e4f225e74f37f1e04b5466f500eed323a7990 100644 (file)
@@ -54,27 +54,21 @@ make_toui (const char *str, const char **error)
   return val;
 }
 
-#if WINDOWS32
-  /* MSVCRT does not support the 'll' format specifier.  */
-# define LLFMT "I64"
-#else
-# define LLFMT "ll"
-#endif
-
 /* Convert val into a string, written to buf.  buf must be large enough
-   to hold the largest possible value, plus a nul byte.  Returns buf.  */
+   to hold the largest possible value, plus a nul byte.  Returns buf.
+   We can't use standard PRI* here: those are based on intNN_t types.  */
 
 char *
 make_lltoa (long long val, char *buf)
 {
-  sprintf (buf, "%" LLFMT "d", val);
+  sprintf (buf, "%" MK_PRI64_PREFIX "d", val);
   return buf;
 }
 
 char *
 make_ulltoa (unsigned long long val, char *buf)
 {
-  sprintf (buf, "%" LLFMT "u", val);
+  sprintf (buf, "%" MK_PRI64_PREFIX "u", val);
   return buf;
 }