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

metze at samba.org metze at samba.org
Mon Oct 2 09:20:20 GMT 2006


Author: metze
Date: 2006-10-02 09:20:18 +0000 (Mon, 02 Oct 2006)
New Revision: 19030

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

Log:
merge missing stuff from samba4:

- strnlen() and strndup() are broken on AIX
- we need some extra CFLAGS on HPUX 11.11

metze
Modified:
   branches/SAMBA_3_0/source/lib/replace/libreplace_cc.m4
   branches/SAMBA_3_0/source/lib/replace/replace.h


Changeset:
Modified: branches/SAMBA_3_0/source/lib/replace/libreplace_cc.m4
===================================================================
--- branches/SAMBA_3_0/source/lib/replace/libreplace_cc.m4	2006-10-02 08:56:35 UTC (rev 19029)
+++ branches/SAMBA_3_0/source/lib/replace/libreplace_cc.m4	2006-10-02 09:20:18 UTC (rev 19030)
@@ -60,8 +60,14 @@
 	*hpux*)
 		# mmap on HPUX is completely broken...
 		AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
+		if test "`uname -r`" = "B.11.11"; then
+			AC_MSG_WARN([Enabling HPUX 11.11 header bug workaround])
+			CFLAGS="$CFLAGS -D_LARGEFILE64_SUPPORT -D__LP64__ -DO_LARGEFILE=04000"
+		fi
 		;;
 	*aix*)
+		AC_DEFINE(BROKEN_STRNDUP, 1, [Whether strndup is broken])
+		AC_DEFINE(BROKEN_STRNLEN, 1, [Whether strnlen is broken])
 		if test "${GCC}" != "yes"; then
 			## for funky AIX compiler using strncpy()
 			CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"

Modified: branches/SAMBA_3_0/source/lib/replace/replace.h
===================================================================
--- branches/SAMBA_3_0/source/lib/replace/replace.h	2006-10-02 08:56:35 UTC (rev 19029)
+++ branches/SAMBA_3_0/source/lib/replace/replace.h	2006-10-02 09:20:18 UTC (rev 19030)
@@ -121,12 +121,14 @@
 size_t rep_strlcat(char *d, const char *s, size_t bufsize);
 #endif
 
-#ifndef HAVE_STRNDUP
+#if (defined(BROKEN_STRNDUP) || !defined(HAVE_STRNDUP))
+#undef HAVE_STRNDUP
 #define strndup rep_strndup
 char *rep_strndup(const char *s, size_t n);
 #endif
 
-#ifndef HAVE_STRNLEN
+#if (defined(BROKEN_STRNLEN) || !defined(HAVE_STRNLEN))
+#undef HAVE_STRNLEN
 #define strnlen rep_strnlen
 size_t rep_strnlen(const char *s, size_t n);
 #endif



More information about the samba-cvs mailing list