From 68460ee88caadefea2adbd4f24755e3dd1cb0a47 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 2 Jan 2005 04:21:32 +0000 Subject: r4472: improve the discard_const() macro for standalone build of talloc (This used to be commit 310cea15bf01343d9ab8ff7a166f0699c0507816) --- source4/lib/talloc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/lib/talloc.c b/source4/lib/talloc.c index 7f50264801..ce1a325ebd 100644 --- a/source4/lib/talloc.c +++ b/source4/lib/talloc.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "talloc.h" #endif @@ -54,7 +55,11 @@ #endif #ifndef discard_const_p -#define discard_const_p(type, ptr) ((type *)(ptr)) +#if defined(__intptr_t_defined) || defined(HAVE_INTPTR_T) +# define discard_const_p(type, ptr) ((type *)((intptr_t)(ptr))) +#else +# define discard_const_p(type, ptr) ((type *)(ptr)) +#endif #endif /* this null_context is only used if talloc_enable_leak_report() or -- cgit