summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorLibravatar Jason Riedy <ejr@EECS.Berkeley.EDU>2007-02-19 16:22:56 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2007-02-19 18:20:30 -0800
commitbc6b4f52fc79712db637ff90a472b82b32695e11 (patch)
tree6a1f85627af40c0079f01e7099701efb349c81b2 /compat
parentgit-clone: Sync documentation to usage note. (diff)
downloadtgif-bc6b4f52fc79712db637ff90a472b82b32695e11.tar.xz
Add a compat/strtoumax.c for Solaris 8.
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>
Diffstat (limited to 'compat')
-rw-r--r--compat/strtoumax.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/compat/strtoumax.c b/compat/strtoumax.c
new file mode 100644
index 0000000000..5541353a77
--- /dev/null
+++ b/compat/strtoumax.c
@@ -0,0 +1,10 @@
+#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
+}