git-commit-vandalism/compat/strtoimax.c
Nick Alcock e3eed7f8d2 Add strtoimax() compatibility function.
Since systems that omit strtoumax() will likely omit strtomax() too, and
likewise for strtoull() and strtoll(), we arrange for the make variables
NO_STRTOUMAX and NO_STRTOULL to cover both the signed and unsigned
functions, and define compatibility implementations for them.

Signed-off-by: Nick Alcock <nix@esperi.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-11-02 13:06:30 -07:00

11 lines
214 B
C

#include "../git-compat-util.h"
intmax_t gitstrtoimax (const char *nptr, char **endptr, int base)
{
#if defined(NO_STRTOULL)
return strtol(nptr, endptr, base);
#else
return strtoll(nptr, endptr, base);
#endif
}