mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-02-04 22:02:19 +00:00
* src/misc.c (make_lltoa): Use printf format macro from makeint.h
(make_ulltoa): Ditto.
This commit is contained in:
parent
ca92d83cde
commit
7ddfc42ee3
1 changed files with 4 additions and 10 deletions
14
src/misc.c
14
src/misc.c
|
@ -54,27 +54,21 @@ make_toui (const char *str, const char **error)
|
||||||
return val;
|
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
|
/* 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 *
|
char *
|
||||||
make_lltoa (long long val, char *buf)
|
make_lltoa (long long val, char *buf)
|
||||||
{
|
{
|
||||||
sprintf (buf, "%" LLFMT "d", val);
|
sprintf (buf, "%" MK_PRI64_PREFIX "d", val);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
make_ulltoa (unsigned long long val, char *buf)
|
make_ulltoa (unsigned long long val, char *buf)
|
||||||
{
|
{
|
||||||
sprintf (buf, "%" LLFMT "u", val);
|
sprintf (buf, "%" MK_PRI64_PREFIX "u", val);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue