aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-11-30 19:02:56 +0000
committerRoger Dingledine <arma@torproject.org>2007-11-30 19:02:56 +0000
commitfa2c3a73e4dbbe69c311d6a2ded4e5cc0d6be665 (patch)
treeb6e1ab88c34d592ccf755356007b188f6e33e758 /src
parentad0fcef5763ba9e581938b10ec04910fd248824a (diff)
downloadtor-fa2c3a73e4dbbe69c311d6a2ded4e5cc0d6be665.tar
tor-fa2c3a73e4dbbe69c311d6a2ded4e5cc0d6be665.tar.gz
make dmalloc 5.4.2 work again too
svn:r12615
Diffstat (limited to 'src')
-rw-r--r--src/common/util.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 03670c503..ffbd0e6c0 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -79,8 +79,17 @@ const char util_c_id[] = "$Id$";
#undef strndup
#include <dmalloc.h>
#define DMALLOC_FN_ARGS , file, line
- #define dmalloc_strdup(file, line, string, xalloc_b) dmalloc_strndup(file, line, (string), -1, xalloc_b)
-#else
+
+ #if defined(HAVE_DMALLOC_STRDUP)
+ /* the dmalloc_strdup should be fine as defined */
+ #elif defined(HAVE_DMALLOC_STRNDUP)
+ #define dmalloc_strdup(file, line, string, xalloc_b) \
+ dmalloc_strndup(file, line, (string), -1, xalloc_b)
+ #else
+ #error "No dmalloc_strdup or equivalent"
+ #endif
+
+#else /* not using dmalloc */
#define dmalloc_strdup(file, line, string, xalloc_b) strdup(string)
#define dmalloc_malloc(file, line, size, func_id, alignment, xalloc_b) \