aboutsummaryrefslogtreecommitdiff
path: root/compat/strtoimax.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/strtoimax.c')
-rw-r--r--compat/strtoimax.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/compat/strtoimax.c b/compat/strtoimax.c
new file mode 100644
index 000000000..ac09ed89e
--- /dev/null
+++ b/compat/strtoimax.c
@@ -0,0 +1,10 @@
+#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
+}