(e.g. HP-UX).
--HG--
branch : HEAD
AC_PROG_LIBTOOL
AM_ICONV
-AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h \
+AC_CHECK_HEADERS(strings.h stdint.h unistd.h dirent.h malloc.h inttypes.h \
sys/uio.h sys/sysmacros.h sys/resource.h sys/select.h libgen.h \
sys/quota.h sys/fs/ufs_quota.h ufs/ufs/quota.h jfs/quota.h \
mntent.h sys/mnttab.h sys/event.h sys/time.h sys/mkdev.h linux/dqblk_xfs.h \
AC_CHECK_FUNCS(fcntl flock lockf inet_aton sigaction getpagesize madvise \
strcasecmp stricmp vsyslog writev pread \
setrlimit setproctitle seteuid setreuid setegid setresgid \
- strtoull strtouq setpriority quotactl getmntent kqueue kevent \
- backtrace_symbols walkcontext dirfd clearenv \
- malloc_usable_size)
+ strtoull strtoll strtoumax strtoimax strtouq strtoq \
+ setpriority quotactl getmntent kqueue kevent backtrace_symbols \
+ walkcontext dirfd clearenv malloc_usable_size)
dnl * I/O loop function
have_ioloop=no
#include <ctype.h>
#include <unistd.h>
#include <syslog.h>
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h> /* for strtoimax() and strtoumax() */
+#endif
#ifndef INADDR_NONE
# define INADDR_NONE INADDR_BROADCAST
#ifndef HAVE_STRTOULL
unsigned long long int my_strtoull(const char *nptr, char **endptr, int base)
{
-#ifdef HAVE_STRTOUQ
+#ifdef HAVE_STRTOUMAX
+ return strtoumax(nptr, endptr, base);
+#elif defined(HAVE_STRTOUQ)
return strtouq(nptr, endptr, base);
#else
unsigned long ret = 0;
#endif
}
#endif
+
+#ifndef HAVE_STRTOLL
+unsigned long long int my_strtoll(const char *nptr, char **endptr, int base)
+{
+#ifdef HAVE_STRTOIMAX
+ return strtoimax(nptr, endptr, base);
+#elif defined (HAVE_STRTOQ)
+ return strtoq(nptr, endptr, base);
+#else
+ i_panic("strtoll() not implemented");
+#endif
+}
+#endif
# define strtoull my_strtoull
unsigned long long int my_strtoull(const char *nptr, char **endptr, int base);
#endif
+#ifndef HAVE_STRTOLL
+# define strtoll my_strtoll
+unsigned long long int my_strtoll(const char *nptr, char **endptr, int base);
+#endif
/* ctype.h isn't safe with signed chars,
use our own instead if really needed */