From 3189d141522d7d710fa8c7f58e92bffd854088ce Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 18 Oct 2008 14:07:51 +0200 Subject: Use the new memory macro file from Samba 3. --- lib/util/memory.h | 8 ++++++++ lib/util/util_file.c | 1 - lib/util/xfile.c | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/util/memory.h b/lib/util/memory.h index 62686df40d0..29dd75060f9 100644 --- a/lib/util/memory.h +++ b/lib/util/memory.h @@ -40,12 +40,20 @@ /** * Allocate an array of elements of one data type. Does type-checking. */ +#if _SAMBA_BUILD_ == 3 +#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count, false) +#else #define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count) +#endif /** * Resize an array of elements of one data type. Does type-checking. */ +#if _SAMBA_BUILD_ == 3 +#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count, false) +#else #define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count) +#endif /** * zero a structure diff --git a/lib/util/util_file.c b/lib/util/util_file.c index 176ff75e026..0275e78c54f 100644 --- a/lib/util/util_file.c +++ b/lib/util/util_file.c @@ -25,7 +25,6 @@ #if _SAMBA_BUILD_ == 3 #undef malloc #undef realloc -#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count, false) #endif /** diff --git a/lib/util/xfile.c b/lib/util/xfile.c index e8bb811416a..94b0ee9b189 100644 --- a/lib/util/xfile.c +++ b/lib/util/xfile.c @@ -38,7 +38,6 @@ #if _SAMBA_BUILD_ == 3 #undef malloc -#define malloc_p(type) malloc(sizeof(type)) #endif #define XBUFSIZE BUFSIZ -- cgit