mirror of
https://github.com/git/git.git
synced 2024-11-28 04:23:30 +08:00
bc6b4f52fc
Solaris 8 was pre-c99, and they weren't willing to commit to the strtoumax definition according to /usr/include/inttypes.h. This adds NO_STRTOUMAX and NO_STRTOULL for ancient systems. If NO_STRTOUMAX is defined, the routine in compat/strtoumax.c will be used instead. That routine passes its arguments to strtoull unless NO_STRTOULL is defined. If NO_STRTOULL, then the routine uses strtoul (unsigned long). Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu> Acked-by: Shawn O Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
11 lines
217 B
C
11 lines
217 B
C
#include "../git-compat-util.h"
|
|
|
|
uintmax_t gitstrtoumax (const char *nptr, char **endptr, int base)
|
|
{
|
|
#if defined(NO_STRTOULL)
|
|
return strtoul(nptr, endptr, base);
|
|
#else
|
|
return strtoull(nptr, endptr, base);
|
|
#endif
|
|
}
|