summaryrefslogtreecommitdiff
path: root/compat/strtoimax.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-12-28 11:32:33 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-12-28 11:32:33 -0800
commite39888ba21b68888e1db2d989155f23ea78fc842 (patch)
tree58c214720ef480aa1bbad0d53fd2fa40683346a9 /compat/strtoimax.c
parentMerge branch 'jk/refresh-porcelain-output' into maint (diff)
parentSupport sizes >=2G in various config options accepting 'g' sizes. (diff)
downloadtgif-e39888ba21b68888e1db2d989155f23ea78fc842.tar.xz
Merge branch 'na/strtoimax' into maint
* na/strtoimax: Support sizes >=2G in various config options accepting 'g' sizes. Compatibility: declare strtoimax() under NO_STRTOUMAX Add strtoimax() compatibility function.
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 0000000000..ac09ed89e7
--- /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
+}