summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-02 04:21:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:55 -0500
commit68460ee88caadefea2adbd4f24755e3dd1cb0a47 (patch)
tree2aa53db31bc506bd2c8cf4549bdb938b089e40c6
parentb099aa9696ea6f956b7e72c43da259419205ae07 (diff)
downloadsamba-68460ee88caadefea2adbd4f24755e3dd1cb0a47.tar.gz
samba-68460ee88caadefea2adbd4f24755e3dd1cb0a47.tar.bz2
samba-68460ee88caadefea2adbd4f24755e3dd1cb0a47.zip
r4472: improve the discard_const() macro for standalone build of talloc
(This used to be commit 310cea15bf01343d9ab8ff7a166f0699c0507816)
-rw-r--r--source4/lib/talloc.c7
1 files changed, 6 insertions, 1 deletions
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 <stdlib.h>
#include <string.h>
#include <stdarg.h>
+#include <stdint.h>
#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