svn commit: samba r18449 - in branches/SAMBA_3_0/source: . lib

vlendec at samba.org vlendec at samba.org
Wed Sep 13 09:32:24 GMT 2006


Author: vlendec
Date: 2006-09-13 09:32:24 +0000 (Wed, 13 Sep 2006)
New Revision: 18449

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18449

Log:
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

Modified:
   branches/SAMBA_3_0/source/configure.in
   branches/SAMBA_3_0/source/lib/replace.c


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===================================================================
--- branches/SAMBA_3_0/source/configure.in	2006-09-13 09:27:33 UTC (rev 18448)
+++ branches/SAMBA_3_0/source/configure.in	2006-09-13 09:32:24 UTC (rev 18449)
@@ -1274,7 +1274,7 @@
 fi
 
 AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strndup strnlen strerror chown fchown chmod fchmod chroot link mknod mknod64)
-AC_CHECK_FUNCS(strtol strtoll strtoul strtoull)
+AC_CHECK_FUNCS(strtol strtoll strtoul strtoull strtouq __strtoull)
 AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync memset strlcpy strlcat setpgid)
 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)

Modified: branches/SAMBA_3_0/source/lib/replace.c
===================================================================
--- branches/SAMBA_3_0/source/lib/replace.c	2006-09-13 09:27:33 UTC (rev 18448)
+++ branches/SAMBA_3_0/source/lib/replace.c	2006-09-13 09:32:24 UTC (rev 18449)
@@ -415,6 +415,21 @@
 }
 #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)
 {



More information about the samba-cvs mailing list