diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-10-20 09:48:24 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-10-20 09:48:24 +0100 |
commit | 67c1c65bf2ef7752c036563e4dda4bea064569b2 (patch) | |
tree | 3c3659428671e400b15fad5b97caa9a39d2b83f8 /utils | |
parent | 51c2d48096f8f53583422113508912b3243c48f0 (diff) | |
download | netsurf-67c1c65bf2ef7752c036563e4dda4bea064569b2.tar.gz netsurf-67c1c65bf2ef7752c036563e4dda4bea064569b2.tar.bz2 |
attempt a different fix for amiga os 3 strtoull
Diffstat (limited to 'utils')
-rw-r--r-- | utils/config.h | 8 | ||||
-rw-r--r-- | utils/utils.c | 13 | ||||
-rw-r--r-- | utils/utils.h | 4 |
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. * |