Code

Add a compat/strtoumax.c for Solaris 8.
[git.git] / compat / strtoumax.c
diff --git a/compat/strtoumax.c b/compat/strtoumax.c
new file mode 100644 (file)
index 0000000..5541353
--- /dev/null
@@ -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
+}