summaryrefslogtreecommitdiffstats
path: root/server/util/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/util/util.h')
-rw-r--r--server/util/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/util/util.h b/server/util/util.h
index dda7527ee..ea7f44e83 100644
--- a/server/util/util.h
+++ b/server/util/util.h
@@ -104,6 +104,14 @@ void debug_fn(const char *format, ...);
#define talloc_zfree(ptr) do { talloc_free(ptr); ptr = NULL; } while(0)
#endif
+#ifndef discard_const_p
+#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
+
/* TODO: remove later
* These functions are available in the latest tevent and are the ones that
* should be used as tevent_req is rightfully opaque there */