summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/config.h8
-rw-r--r--utils/utils.c13
-rw-r--r--utils/utils.h4
3 files changed, 21 insertions, 4 deletions
diff --git a/utils/config.h b/utils/config.h
index 5678beaa3..a87f19b53 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -67,6 +67,14 @@ char *strcasestr(const char *haystack, const char *needle);
char *strchrnul(const char *s, int c);
#endif
+/*
+ * amigaos3 declares this but does not have it in its actual library
+ */
+#define HAVE_STRTOULL
+#if !defined(__amigaos4__) && defined(__AMIGA__)
+#undef HAVE_STRTOULL
+#endif
+
#define HAVE_SYS_SELECT
#define HAVE_POSIX_INET_HEADERS
#if (defined(_WIN32))
diff --git a/utils/utils.c b/utils/utils.c
index c5c1529a3..b260f373e 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -283,6 +283,19 @@ char *human_friendly_bytesize(unsigned long long int bsize) {
}
+#ifndef HAVE_STRTOULL
+/**
+ * string to unsigned long long
+ *
+ */
+unsigned long long int _strtoull(const char *nptr, char **endptr, int base)
+{
+ return (unsigned long long int)strtoul(nptr, endptr, base);
+}
+
+#endif
+
+
#ifndef HAVE_STRCASESTR
/**
diff --git a/utils/utils.h b/utils/utils.h
index 31a86c60e..3995071cd 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -75,10 +75,6 @@
#define ceilf(x) (float)ceil((double)x)
#endif
-#if !defined(__amigaos4__) && defined(__AMIGA__)
-#define strtoull(n,e,b) (unsigned long long int)strtoul(n,e,b)
-#endif
-
/**
* Calculate length of constant C string.
*