summaryrefslogtreecommitdiff
path: root/source3/lib/replace.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/replace.c')
-rw-r--r--source3/lib/replace.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/lib/replace.c b/source3/lib/replace.c
index 19b37af938..38f0af24d9 100644
--- a/source3/lib/replace.c
+++ b/source3/lib/replace.c
@@ -415,6 +415,21 @@ char *rep_inet_ntoa(struct in_addr ip)
}
#endif /* HAVE_STRTOUL */
+#ifndef HAVE_STRTOULL
+unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
+{
+#ifdef HAVE_STRTOUQ
+ return strtouq(str, endptr, base);
+#elif defined(HAVE___STRTOULL)
+ return __strtoull(str, endptr, base);
+#elif SIZEOF_LONG == SIZEOF_LONG_LONG
+ return (unsigned long long int) strtoul(str, endptr, base);
+#else
+# error "You need a strtoull function"
+#endif
+}
+#endif
+
#ifndef HAVE_SETLINEBUF
int setlinebuf(FILE *stream)
{