diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-09-13 09:32:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:51:42 -0500 |
commit | f8346687d950ed643e8fa7d0b1a9c27f2880cc85 (patch) | |
tree | ea01f8a299341f14722943636734e6586482a058 /source/lib/replace.c | |
parent | f47bffa21ec1caf5ec3a6ec77af801df0b63d83a (diff) | |
download | samba-f8346687d950ed643e8fa7d0b1a9c27f2880cc85.tar.gz samba-f8346687d950ed643e8fa7d0b1a9c27f2880cc85.tar.xz samba-f8346687d950ed643e8fa7d0b1a9c27f2880cc85.zip |
r18449: Attempt to fix the build on non-linux platforms: Many of those don't have
strtoull. This is a copy of the stuff in samba4 libreplace, which is GPL. I
hope it is ok to copy&paste it into a GPL file. Tridge, we could also create a
replace_lpgl.c if needed.
Volker
Diffstat (limited to 'source/lib/replace.c')
-rw-r--r-- | source/lib/replace.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/lib/replace.c b/source/lib/replace.c index 19b37af9386..38f0af24d99 100644 --- a/source/lib/replace.c +++ b/source/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) { |