summaryrefslogtreecommitdiff
path: root/source4/lib/talloc/testsuite.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-05-07 22:10:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:32 -0500
commitc1d31ac8fc22a46d3ce7d99058e48058464f4e06 (patch)
treeae9908cc38901aa3fe5b814c231166e8bd31969e /source4/lib/talloc/testsuite.c
parent13bb5c34863c85f7d0cec13d7649ade242acbd52 (diff)
downloadsamba-c1d31ac8fc22a46d3ce7d99058e48058464f4e06.tar.gz
samba-c1d31ac8fc22a46d3ce7d99058e48058464f4e06.tar.bz2
samba-c1d31ac8fc22a46d3ce7d99058e48058464f4e06.zip
r6660: Sorry for the spam... I think now I've got a version that should compile on
trunk, 3_0 and 4_0. Volker (This used to be commit 777c489cad610fef140ec80d5644111b04a314c1)
Diffstat (limited to 'source4/lib/talloc/testsuite.c')
-rw-r--r--source4/lib/talloc/testsuite.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source4/lib/talloc/testsuite.c b/source4/lib/talloc/testsuite.c
index 967874917d..0447749abd 100644
--- a/source4/lib/talloc/testsuite.c
+++ b/source4/lib/talloc/testsuite.c
@@ -35,6 +35,10 @@
/* 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)
{
@@ -51,6 +55,14 @@ static double timeval_elapsed(struct timeval *tv)
}
#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 @@ BOOL torture_local_talloc(void)
-#ifndef _SAMBA_BUILD_
+#if !defined(_SAMBA_BUILD_) || ((SAMBA_VERSION_MAJOR==3)&&(SAMBA_VERSION_MINOR<9))
int main(void)
{
if (!torture_local_talloc()) {