svn commit: samba r6660 - in branches/SAMBA_4_0/source/lib/talloc: .

vlendec at samba.org vlendec at samba.org
Sat May 7 22:10:27 GMT 2005


Author: vlendec
Date: 2005-05-07 22:10:26 +0000 (Sat, 07 May 2005)
New Revision: 6660

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

Log:
Sorry for the spam... I think now I've got a version that should compile on
trunk, 3_0 and 4_0.

Volker

Modified:
   branches/SAMBA_4_0/source/lib/talloc/talloc.c
   branches/SAMBA_4_0/source/lib/talloc/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c	2005-05-07 22:09:42 UTC (rev 6659)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c	2005-05-07 22:10:26 UTC (rev 6660)
@@ -29,6 +29,16 @@
 
 #ifdef _SAMBA_BUILD_
 #include "includes.h"
+#if ((SAMBA_VERSION_MAJOR==3)&&(SAMBA_VERSION_MINOR<9))
+/* This is to circumvent SAMBA3's paranoid malloc checker. Here in this file
+ * we trust ourselves... */
+#ifdef malloc
+#undef malloc
+#endif
+#ifdef realloc
+#undef realloc
+#endif
+#endif
 #else
 #include <stdio.h>
 #include <stdlib.h>
@@ -1081,7 +1091,6 @@
 	return cleanup_context;
 }
 
-
 size_t talloc_get_size(const void *context)
 {
 	struct talloc_chunk *tc;

Modified: branches/SAMBA_4_0/source/lib/talloc/testsuite.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2005-05-07 22:09:42 UTC (rev 6659)
+++ branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2005-05-07 22:10:26 UTC (rev 6660)
@@ -35,7 +35,11 @@
 /* the test suite can be built standalone, or as part of Samba */
 #ifndef _SAMBA_BUILD_
 typedef enum {False=0,True=1} BOOL;
+#endif
 
+/* Samba3 does not define the timeval functions below */
+#if !defined(_SAMBA_BUILD_) || ((SAMBA_VERSION_MAJOR==3)&&(SAMBA_VERSION_MINOR<9))
+
 static struct timeval timeval_current(void)
 {
 	struct timeval tv;
@@ -51,6 +55,14 @@
 }
 #endif /* _SAMBA_BUILD_ */
 
+#if SAMBA_VERSION_MAJOR<4
+#ifdef malloc
+#undef malloc
+#endif
+#ifdef strdup
+#undef strdup
+#endif
+#endif
 
 #define CHECK_SIZE(ptr, tsize) do { \
 	if (talloc_total_size(ptr) != (tsize)) { \
@@ -827,7 +839,7 @@
 
 
 
-#ifndef _SAMBA_BUILD_
+#if !defined(_SAMBA_BUILD_) || ((SAMBA_VERSION_MAJOR==3)&&(SAMBA_VERSION_MINOR<9))
  int main(void)
 {
 	if (!torture_local_talloc()) {



More information about the samba-cvs mailing list