summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-08-23 11:31:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:36 -0500
commit6ac7ea5027428c006ac79889ce9a2bb059450387 (patch)
tree59cd22776987b5dfc8de20005713f4156660e7b8
parent78525245329a627460db6bbcfd85f29bff2ff373 (diff)
downloadsamba-6ac7ea5027428c006ac79889ce9a2bb059450387.tar.gz
samba-6ac7ea5027428c006ac79889ce9a2bb059450387.tar.bz2
samba-6ac7ea5027428c006ac79889ce9a2bb059450387.zip
r17749: more HPUX madness
(This used to be commit 444e92890f08cdc0f5b84e964d1cc6a812e1073e)
-rw-r--r--source4/lib/ldb/replace/config.m41
-rw-r--r--source4/lib/ldb/replace/replace.c32
2 files changed, 33 insertions, 0 deletions
diff --git a/source4/lib/ldb/replace/config.m4 b/source4/lib/ldb/replace/config.m4
index 794618e62d..ebc2568658 100644
--- a/source4/lib/ldb/replace/config.m4
+++ b/source4/lib/ldb/replace/config.m4
@@ -6,6 +6,7 @@ AC_CHECK_TYPE(comparison_fn_t,
[AC_DEFINE(HAVE_COMPARISON_FN_T, 1,[Whether or not we have comparison_fn_t])])
AC_CHECK_FUNCS(strerror timegm strnlen)
+AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq)
AC_HAVE_DECL(errno, [#include <errno.h>])
AC_CHECK_HEADERS(strings.h)
diff --git a/source4/lib/ldb/replace/replace.c b/source4/lib/ldb/replace/replace.c
index 21d57605d0..2c2068f8f4 100644
--- a/source4/lib/ldb/replace/replace.c
+++ b/source4/lib/ldb/replace/replace.c
@@ -35,3 +35,35 @@
return i;
}
#endif
+
+#ifndef HAVE_STRTOLL
+ long long int strtoll(const char *str, char **endptr, int base)
+{
+#ifdef HAVE_STRTOQ
+ return strtoq(str, endptr, base);
+#elif defined(HAVE___STRTOLL)
+ return __strtoll(str, endptr, base);
+#elif SIZEOF_LONG == SIZEOF_LONG_LONG
+ return (long long int) strtol(str, endptr, base);
+#else
+# error "You need a strtoll function"
+#endif
+}
+#endif
+
+
+#ifndef HAVE_STRTOULL
+ unsigned long long int 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
+